This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]