delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/01/19/16:50:52

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <002601c1a133$921c0b40$0100a8c0@advent02>
From: "Chris January" <chris AT atomice DOT net>
To: <cygwin AT cygwin DOT com>
Subject: problem with sigaction and SA_NOCLDSTOP
Date: Sat, 19 Jan 2002 21:52:19 -0000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019