[Haskell-cafe] syscall, sigpause and EINTR on Mac OSX

Donn Cave donn at drizzle.com
Sun Dec 11 15:35:13 EST 2005


Quoth Joel Reymont <joelr1 at gmail.com>:
...
| My program is currently stuck here. The man pages say that sigpause  
| will only terminate by being interrupted and EINTR will be the errno.  
| EINTR is signal 2, the same one that I'm trapping and the one sent  
| when ^C is pressed.

I sure haven't been able to follow all of the ensuing discussion on
this, but in case it helps -- EINTR is not a signal, it's an error
status from a function that was interrupted by a signal.  Just going
on this error, the signal may have been SIGINT - or any other signal,
such as for example SIGALRM, which could be generated by a timer function
(see alarm, setitimer), or SIGCHLD, which could be generated on exit of
a child process under certain circumstances.  Etc.

Obviously the use of signals in this way (timers, for example) has the
potential to make your application unsound.  It's particularly insidious
when it occurs in library functions.

Now if you actually have observed that your SIGINT handler was entered
at this point, then please ignore me.

	Donn Cave, donn at drizzle.com


More information about the Haskell-Cafe mailing list