X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_BL_SPAMCOP_NET,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: Sat, 19 Sep 2009 10:31:58 +0000 (UTC) Lines: 50 Message-ID: References: <20090918213522 DOT GA12527 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: > > Thanks for the test case. The problem has nothing to do with anything > "special" about SIGCHLD. It's a signal like any other signal. > I am not sure it's clear. With regard to sigwait() SIGCHLD like any other signal must not only be blocked, additionally like any other signal it cannot be ignored, which is not common as only few signals are ignored by default, and SIGCHLD and SIGWINCH are in this group. POSIX is explicit here: http://www.opengroup.org/onlinepubs/9699919799/ 2.4.1 Signal Generation and Delivery However, a signal can be "blocked" from delivery to a thread. If the action associated with a blocked signal is anything other than to ignore the signal, and if that signal is generated for the thread, the signal shall remain pending until it is unblocked, it is accepted when it is selected and returned by a call to the sigwait() function, or the action associated with it is set to ignore the signal. Simply a signal must be blocked and (actually) not ignored to be processed by sigwait(). > Cygwin was not performing sigwait() processing if there was a handler > set up for the signal. Your test case would have worked if you had not > set up a dummy handler. > As stated above a handler is the must, otherwise the test won't work under POSIX systems. > This will be fixed in the next snapshot. > Thanks, 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