longjmp out of signal handler (was Re: alloca() portability)

Stanley Friesen sarima at tdatirv.UUCP
Thu Nov 22 12:27:03 AEST 1990


In article <1990Nov16.181436.21736 at zoo.toronto.edu> henry at zoo.toronto.edu (Henry Spencer) writes:
>In case Chris doesn't have paragraphs to spare right now, here's a few
>sentences. :-)  It is extremely difficult to guarantee that anything
>will work portably in signal handlers, because the stranger C environments
>put bizarre restrictions on them due to difficulties with calling conventions
>and the like.

Just to emphasize this point, I have recently come across a real implementation
where such a restriction exists.

I am currently learning the library interface to AmigaDOS, and its
implementation of 'signals' totally prohibits longjumps out of the handler.
This is due to several factors - mostly involving system resource handling
and task scheduling. (Get this, by default the handler is activated in
*supervisor* mode!! You really want to long jump out of that!?!?)
-- 
---------------
uunet!tdatirv!sarima				(Stanley Friesen)



More information about the Comp.lang.c mailing list