03-14-06 07:49 AM
Hello, "Nils!
You wrote on Tue, 14 Mar 2006 08:22:53 +0100:
??>> I can't grasp the point of using WNOHANG in 'waitpid()', when it's
??>> called inside of handler reaping children? According to man page
??>> WNOHANG 'means to return immediately if no child has exited', but if
??>> the handler was invoked, the signal has already been sent, right?
NOS> This is to ensure you collect all children.
NOS> unix signals doesn't queue - if more than one child died at about
NOS> the same time that might result in just one SIGCHLD.
If it may result in only one SIGCHLD, what happens with other children
signals from which I didn't receive?
NOS> Thus you should call waitpid in a loop to be sure you reap all of
NOS> them.
With best regards, Roman Mashak. E-mail: mrv@tusur.ru
[ Post a follow-up to this message ]
|