This is one of the places where Unix crashes - there really needs to be the concept of a file descriptor for a process that can be passed to select(which is equivalent to Unix WaitForMultipleObjects); but this is not so.
SIGCHLD. wait4 waitpid ( , , wait, ) , WNOHANG, 0. PID . , . ( - waitpid write) , , " " sigsuspend .