The system () function seems to return 128 times the exit code that I get from the called process.
On the man page:
RETURN VALUE The return value is -1 on error (for example, fork (2) failed), and the return status of the other command is wise.
Here is what I have.
$ ls tinker.c tinker.c $ echo $? 0 $ ls notexisting ls: cannot access notexisting: No such file or directory $ echo $? 2 $ cat tinker.c
The first call indicates that I am not getting crashes, but the return codes do not look the way I read from the man page. What am I doing wrong?
source share