confusion about signals
Henry Cejtin
henry@sourcelight.com
Mon, 18 Mar 2002 14:31:57 -0600
The way you are SUPPOSED to use sigsuspend, and the reason for the argument,
is that you block SIGCHLD, then you do the fork, then you do sigsuspend with
a mask which lets it get through. You are now using the fact that sigsuspend
guarentees that the changing of the blocked mask and the waiting for a signal
are done atomically.
Note, in general SIGCHLD is a stupid signal and I don't believe that I have
ever used it. If you want to wait for a child to finish, just use wait() or
waitpid(). I can imagine cases where it might be useful, but they are all
pretty strange. What are you using it for?