delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/03/21/22:46:51

X-Spam-Check-By: sourceware.org
Date: Tue, 21 Mar 2006 22:46:39 -0500
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
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: <BAY102-F1419989AED32B053AE39DABD0E0 AT phx DOT gbl> <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
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
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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/

- Raw text -


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