If you want a quick and dirty answer, it's this: The system will return 256*n, not 128+n. But you don't want that; your call could have terminated not because the called program exited, but because it got killed or something.
If you want to do things right, try this command:
man 3 system
That will, in turn, direct you to try this command:
man 2 wait
In that man page, read about the various macros you can apply to the returned status to see whether it returned by exit, by signal, or whatever; and also which signal it was (if it was terminated by a signal), or what the return code was (if it exited).
Hope this helps.
|