pid_t wait(int *wstatus);
int status; wait (&status);
WIFEXITED(wtatus)
: returns true if the process exited normally.
WEXITSTATUS(wstatus)
: returns the exit status of the process (ie the value returned by exit, _exit, return, but ONLY IF WIFEXITED is true.
WIFSIGNALED(wstatus)
: returns true if the child was terminated by a signal.
WTERMSIG(wstatus)
: returns the signal number that terminated thechild, BUT ONLY IF WSIGNALED is true.
WCOREDUMP(wstatus)
: returns true only if the child produced a core dump, but ONLY IF WIFSIGNALED is true.
WIFSTOPPED(wstatus)
: returns true if the process was stopped. Special conditions apply
WSTOPSIG(wstatus)
: returns the signal that caused the stop, but only if WIFSTOPPED was true.
WIFCONTINUED(wstatus)
: returns true if the child proces was continued.