I’ve got something that uses a bunch of async forks to do it’s work (underneath a toolkit).
In a specific region of code, I’m forking, and then doing a blocking wait on the child process.
Is the SIGCHLD handler going to gobble the signal before the blocking wait will see it, leaving me potentially hung, or is the wait always going to get something back?
A
SIGCHLDhandler gets fired on the event, the edge, of a child process exiting. A blocking call towaitpid()will wait for the condition, the level, of that specific child process no longer existing.When the process exits, a
SIGCHLDwill be delivered, and its handler will execute normally. If there was awaitpid()blocking on that process, it will then return as normal, regardless of the presence of a signal handler.