This is the mail archive of the
mailing list for the Cygwin project.
Re: signal is not delivered to the handler
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.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html