__attribute__((cleanup(function)) versus try/finally
Jamie Lokier
jamie@shareable.org
Fri May 9 12:49:00 GMT 2003
Andrew Haley wrote:
> > 1. Linux does not care if the signal handler returns or not (unlike
> > Windows).
>
> Actually, the C standard is quite explicit about this: signal handlers
> may return either by a return statement of calling longjmp(). Maybe
> the Windows version of longjmp() does some magic to make this work.
Last time I tried it (a few years ago now), longjmp() out of a signal
handler which is interrupting a select() system call crashed Cygwin.
So, I had to use a different strategy for picking up SIGCHLD events on
that platform - limiting select() calls to a maximum timeout of a few
seconds.
-- Jamie
More information about the Gcc
mailing list