X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=BAYES_00,RCVD_NUMERIC_HELO,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Waldemar Rachwal Subject: Re: [1.7] sigwait bug (SIGCHLD delayed to a next regular signal) Date: Mon, 21 Sep 2009 18:01:49 +0000 (UTC) Lines: 50 Message-ID: References: <20090918213522 DOT GA12527 AT ednor DOT casa DOT cgf DOT cx> <20090919144319 DOT GA31739 AT ednor DOT casa DOT cgf DOT cx> <20090921153356 DOT GA16100 AT ednor DOT casa DOT cgf DOT cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Christopher Faylor cygwin.com> writes: > > > >To satisfy the condition (quoted from posix) "action is anything other > >than to ignore", SIGCHLD (and all other signals which default action is > >to ignore) must be setup a handler even if it seems "not useful". > >Being blocked is not sufficient. > > Ok. Yes, I was wrong about the meaning of action but, as I said, this > works fine on Linux without setting a dummy handler. The reason for that > is that SIGCHLD is, by default, set to SIG_DFL not SIG_IGN. I knew that. My understanding of "action is anything to ignore" was (and still is): either SIG_DFL + "default action to ignore" or forcibly ignored by a user by means of SIG_IGN. > To quote from Roland McGrath (one of the glibc maintainers): > > "When a signal is set to SIG_IGN, it's true that the signal may be > dropped at generation time and never recorded. But POSIX does not allow > this for signals set to SIG_DFL, even when the default action for the > signal is to ignore it. In this case, the rule when the signal is > blocked is that it must become pending--this allows a sigaction call > before unblocking the signal to change its action." So then, how would you interpret the following statement (from POSIX)? (2.4.3 Signal Actions / SIG_DFL, 6th paragraph) http://www.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03_01 "Setting a signal action to SIG_DFL for a signal that is pending, and whose default action is to ignore the signal (for example, SIGCHLD), shall cause the pending signal to be discarded, whether or not it is blocked." Interesting, isn't it? ;) > > This comment comes from a bug report which eventually resulted in a fix > to the linux kernel. > Linux is useful, but isn't any proof. From the fact they change it, one of the implementation may be wrong, and nobody says newer is better :) Sorry, I am not a guru and may be wrong, but still trying to understand the subject while reading the standard. Regards, Waldemar. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple