PREV INDEX NEXT

Author: Unknown
Subject: waitpid, wexitstatus, wifexited
Date: Sunday, 15 Nov 2020, 00:16:32

What actually sets the status int in waitpid? Is that when the child process executes that the status pointer is updated with whatever the status of that child process was? Also, how do WIFEXITED() and WEXITSTATUS still work after the child process exit and are completed? From the pipe.c example, it looks like it is somehow able to remember values of WIFEXITED and WEXITSTATUS just from the status int? I'm a bit confused from the man page.
PREV INDEX NEXT