This is the mail archive of the
mailing list for the Cygwin project.
System calls getting interrupted with signals, even with SA_RESTART
- From: "Robby Dermody" <robbyd at p9i dot com>
- To: <cygwin at cygwin dot com>
- Date: Sat, 13 Dec 2003 14:55:52 -0500
- Subject: System calls getting interrupted with signals, even with SA_RESTART
- Organization: phase9 industries, inc.
I've ran into a little problem. I have been porting an piece of software to
Cygwin. It builds and initially runs fine, but when I get a SIGALRM signal,
which I use for asynchronous timers, a few things return with an EINTR:
-IPC semaphores (using CygIPC)
Note that I am asserting SA_RESTART when I set up the signal handler. The
procedure I take is this:
struct sigaction SigAction;
memset(&SigAction, 0, sizeof(struct sigaction));
SigAction.sa_handler = Internal_Act_HandleTimers;
SigAction.sa_flags = SA_RESTART; //restart system calls interrupted with
if(sigaction(SIGALRM, &SigAction, NULL) < 0)
leprintf(LOGGING_SELF, LVL_SYSERR, "Error initing SIGALRM handler");
The error returned from select is: (errno, strerror(errno)
errno - 4 (Interrupted system call)
Obviously the signal handler is set up correctly, and when just asserting
SA_RESTART didn't work, I tried sticking a call to siginterrupt in there as
well, but had no luck there either.
Is it just a stupid mistake on my end, or something I'm failing to see? The
only other thing that might be the case is that the restarting of select and
the semaphore stuff isn't implemented?
TIA for ANY help!!
Robby Dermody (email@example.com)
phase9 industries, inc. - http://www.p9i.com/
We confide in our strength, without boasting of it; we respect that of
others, without fearing it.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html