If the exit status value (see section Program Termination) of the child
process is zero, then the status value reported by waitpid
or
wait
is also zero. You can test for other kinds of information
encoded in the returned status value using the following macros.
These macros are defined in the header file `sys/wait.h'.
exit
or _exit
.
WIFEXITED
is true of status, this macro returns the
low-order 8 bits of the exit status value from the child process.
See section Exit Status.
WIFSIGNALED
is true of status, this macro returns the
signal number of the signal that terminated the child process.
WIFSTOPPED
is true of status, this macro returns the
signal number of the signal that caused the child process to stop.
Go to the first, previous, next, last section, table of contents.