signal is not delivered to the handler

D.Pageau dpageau@infodev.ca
Wed Mar 22 03:18:00 GMT 2006


> 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 ?

#include <signal.h>
#include <stdio.h>

#define BUFZ    5

void alarm_handler(int signo)
{
        fprintf(stderr, "SIGNAL: %d\n", signo);
}

int main()
{
        char    buff[BUFSIZ];
        FILE    *logfp = NULL;

        siginterrupt(SIGALRM,1);
        signal(SIGALRM, alarm_handler);
        alarm(5);
        fprintf (stderr, "Should timeout by itself in 5 secs\n");
        read(0,buff,BUFSIZ);
        fprintf (stderr, "Timeout\n");
        alarm(0);
        signal(SIGALRM,SIG_DFL);
}


--
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/



More information about the Cygwin mailing list