longjmp out of signal handler

Henry Spencer henry at zoo.toronto.edu
Sat Dec 1 04:28:46 AEST 1990


In article <17 at christmas.UUCP> rtm at christmas.UUCP (Richard Minner) writes:
>Is it the `no nesting' clause that kills it?  If not, then I believe
>that ANSI guarantees at least minimal support for longjmp'ing out of
>handlers...

Although the wording under longjmp() and under signal() could stand to be
a bit more consistent, there is an important distinction under signal()
that I glossed over.  In ANSI C, it is possible to explicitly cause a
signal with the raise() function (or abort(), for that matter).  Signal
handlers invoked thusly are specifically exempt from the restrictions,
so they can call longjmp() portably.  Hence the demand that longjmp() be
usable in signal handlers.  However, the harsher rules still apply to,
so to speak, accidental signals.
-- 
"The average pointer, statistically,    |Henry Spencer at U of Toronto Zoology
points somewhere in X." -Hugh Redelmeier| henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.lang.c mailing list