home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / programm / 4468 < prev    next >
Encoding:
Internet Message Format  |  1992-08-27  |  1.0 KB

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