longjmp() from nested signal handlers

Doug Gwyn gwyn at brl-smoke.ARPA
Sun Apr 10 09:38:35 AEST 1988


In article <147 at chem.ucsd.EDU> tps at chem.ucsd.edu (Tom Stockfisch) writes:
>So it would seem SIGFPE could not be caught portably at all.  If you
>don't return, you violate ANSI, and if you don't exit() or longjmp(),
>the results are undefined.

Somewhere this issue got on the wrong track.  The current dpANS for C
permits longjmp() in the presence of signals as well as from a signal
handler; however, if invoked from a NESTED signal handler the behavior
is undefined.  This is simply a loophole to permit implementors who
would have a hard time making that work correctly to punt on it.  It
is hoped that implementors who can make it work correctly would do so.

SIGFPE can be caught portably, but be aware that there is no requirement
that a SIGFPE be generated, even for division by zero.



More information about the Comp.lang.c mailing list