[LCP]SIGFPE

Jack Lloyd lloyd at acm.jhu.edu
Sat Jul 13 01:29:06 UTC 2002


On Fri, 12 Jul 2002, Paul Gearon wrote:

> On Thu, 11 Jul 2002, Jack Lloyd wrote:
>
> > I'm not totally sure that you're allowed to do longjmp inside a signal
> > handler (actually, I'm pretty sure it's undefined by POSIX). But I've seen
> > it done in several pieces of reasonable portable pieces of software. I've
> > never done this for SIGFPE but I've seen it for SIGILL and done it myself
> > for SIGPIPE.
>
> Actually POSIX explicitly says that this is one of the acceptable ways of
> returning from a signal handler.  Just make damn sure you don't let your
> signal handler do the longjmp (or the siglongjmp) a second time without
> calling setjmp (or sigsetjmp) again.
>
> (No, I don't have my own copy of the POSIX standard, but Stevens said that
> it's in there, so it must be true.  :-)

All hail the great God of Unix documentation! :)

(Thanks for the info - I had been worried that doing this would bite us in
the ass someday).

-J





More information about the linuxCprogramming mailing list