This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: signal is not delivered to the handler
> 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/