home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.programmer:4468 comp.unix.xenix.sco:2754
- Newsgroups: comp.unix.programmer,comp.unix.xenix.sco
- Path: sparky!uunet!uunet.ca!xenitec!golem!davidf
- From: davidf@golem.uucp (David J. Fiander)
- Subject: Re: Calling longjmp() from signal handler: portable?
- References: <2A9BCC57.640F@tct.com>
- Message-ID: <1992Aug27.001355.13362@golem.uucp>
- Date: Thu, 27 Aug 1992 00:13:55 GMT
- Lines: 16
-
- According to chip@tct.com (Chip Salzenberg):
- >Is Ron right that longjmp() always works from signal handlers? Or am
- >I correct that, for example, SCO Xenix sets up a separate stack frame
- >for signal handlers, so longjmp() won't work correctly?
- >
-
- No, he's not. The problem may be because of a different stack,
- but for more systems, it is the fact that while in the signal
- handler the given signal is blocked, so it must be unblocked
- before you can longjump out.
-
- POSIX dictates that the correct way to longjmp out of a signal
- handler is to call sigsetjmp() to set up the environment and
- siglongjmp() to return to the environment.
-
- - David
-