I need to catch the returned value of a child process..
The problem is: with using the waitpid() function I can catch only 8 bits of the returned value
WEXITSTATUS(wstatus) returns the exit status of the child. This consists of the least significant 8 bits of the status argument that the child specified in a call to exit(3) or _exit(2) or as the argument for a return statement in main(). This macro should be employed only if WIFEXITED returned true.
How can I catch the full int value that is returned from main()
?
EDIT: Stackoverflow forced me to edit the question as it linked another answered question but it has nothing to do with mine!