I was doing an exercise for university where I had to return a value with exit, that value was actually a count of something. This could be above 255 (which exit() can\'t ha
As far as I can tell from checking the Single Unix Spec, your system happens to store the exit status in the second-to-rightmost octet, but I don't believe the standard does. So, you should use the macros for at least a few reasons:
WEXITSTATUS
does. Less so with other approaches. If you saw the hand-rolled version of WIFSIGNALED
, would you recognize it? How much longer would it take than WIFSIGNALED
.