This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
problem with sigaction and SA_NOCLDSTOP
- From: "Chris January" <chris at atomice dot net>
- To: <cygwin at cygwin dot com>
- Date: Sat, 19 Jan 2002 21:52:19 -0000
- Subject: problem with sigaction and SA_NOCLDSTOP
sigaction has a flag, SA_NOCLDSTOP, which according to the POSIX spec does
this:
SA_NOCLDSTOP
Do not generate SIGCHLD when children stop.
Now Cygwin presently does not generate a SIGCHLD signal when a child process
terminates if this flag is set in the signal handler. According to the POSIX
spec, a SIGCHLD may be sent for a number of reasons, not just a child
terminating (see below). Programs use the SA_NOCLDSTOP flag to supress the
signal being generated by these other sources so they can reliably detect if
the child process terminates. With Cygwin's current implementation of this
flag the signal is never generated, even when the process terminates so the
parent process will continue to wait for the signal to be generated and not
notice the child has terminated.
Possible reasons for SIGCHLD generation:
CLD_EXITED child has exited
CLD_KILLED child has terminated abnormally and did not create a core file
CLD_DUMPED child has terminated abnormally and created a core file
CLD_TRAPPED traced child has trapped
CLD_STOPPED child has stopped
CLD_CONTINUED stopped child has continued
IMHO, SA_NOCLDSTOP should be used to supress the last two causes of SIGCHLD.
The others should still cause a SIGCHLD signal to be generated.
Regards
Chris (kde-cygwin developer)
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/