X-Spam-Check-By: sourceware.org Date: Tue, 21 Mar 2006 22:46:39 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: signal is not delivered to the handler Message-ID: <20060322034639.GB26647@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20060206050928 DOT GA15260 AT trixie DOT casa DOT cgf DOT cx> <441E135B DOT 8020900 AT infodev DOT ca> <20060320135644 DOT GD24528 AT trixie DOT casa DOT cgf DOT cx> <4420BF24 DOT 2010609 AT infodev DOT ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4420BF24.2010609@infodev.ca> User-Agent: Mutt/1.5.11 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: 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 On Tue, Mar 21, 2006 at 10:06:12PM -0500, D.Pageau wrote: >> If you have a simple test case which illustrates the problem, we'll >> certainly investigate. Otherwise, I doubt that anyone is going to debug >> lzrz for you. > >I was wrong, signal is delivred to handler but read() does not exit with >EINTR on SIGALRM like Linux and FreeBSD does. Did I miss something ? Thanks for the test case. It looks like cygwin's implementation of siginterrupt doesn't match linux's. If you switch the order of calls so that siginterrupt comes second, it will probably work. You can also use sigaction to set up the handler, clearing the SA_RESETHAND flag: struct sigaction sa; sigaction (SIGALRM, NULL, &sa); sa.sa_flags &= ~SA_RESTART; sa.sa_handler = alarm_handler; sigaction (SIGALRM, &sa, NULL); That also works. I'll look into fixing this in the next release of cygwin. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/