← BYTES
Unix IPC·Starter·Ref: 15.1.9
Besides its numeric exit status, what else can a terminated child process's wait status tell the parent?
Have a question about this video? Mention reference 15.1.9 when you contact us.
a.Nothing else is ever available
b.Whether the child exited normally versus was killed by a signal, and if so, which signal
c.The child's entire memory contents at the moment it exited
d.The exact CPU instructions the child executed
The wait status is a small bitfield, not just a single number: macros like WIFEXITED/WEXITSTATUS extract a normal exit code, while WIFSIGNALED/WTERMSIG tell you the child was killed by a signal and which one -- letting a parent distinguish 'the program ran and returned code 1' from 'the program crashed with SIGSEGV', two very different outcomes that look identical if you only check for a non-zero return.
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES1519#UnixIPC