0

I'd like to understand the usage of sigsetjmp(). But I am yet to find a standalone explanation. For example, the following URL mentions other functions like setjmp() and longjmp(), which I don't care. Consequently, I can not follow the explanation there.

http://poincare.matf.bg.ac.rs/~ivana/courses/ps/sistemi_knjige/pomocno/apue/APUE/0201433079/ch10lev1sec15.html

Could anybody provide a stand-alone explanation of sigsetjmp()? Thanks.

P.S. The manpage is also hard to follow.

zerocool
  • 3,256
  • 2
  • 24
  • 40
user1424739
  • 11,937
  • 17
  • 63
  • 152
  • check my old answer [link](https://stackoverflow.com/questions/51914598/skipping-functions-in-return-sequence-of-callers/51914669#51914669) – zerocool Feb 05 '19 at 00:35
  • The very existance of those two functions derives from particularly nasty corner cases of `setjmp` and `longjmp`, so it makes absolutely zero sense to try to understand them without knowing perfectly how `setjmp` and `longjmp` work. You won't find any "standalone" explanation, it would be like searching an explanation of `strcat` that doesn't talk about strings. – Matteo Italia Feb 05 '19 at 01:33
  • You need to understand how `siglongjmp()` interacts with `sigsetjmp()` to have the faintest chance of understanding either. Fundamentally, `sigsetjmp()` and `siglongjmp()` are intended to be used if the jumps might occur from a signal handler. There are extra complications to signal handlers — things like alternative stacks — that `sigsetjmp()` and `siglongjmp()` have to take care of where `setjmp()` and `longjmp()` might not. To a first approximation, use the `sig*jmp` functions and types just as you would the `*jmp` functions and types. But you need to know how to use the 'simpler' ones. – Jonathan Leffler Feb 05 '19 at 01:55
  • At least `signal mask` needs to be explained as stand alone. Could you explain what it is? – user1424739 Feb 05 '19 at 11:44
  • The signal mask is described on the [sigprocmask(2)](http://man7.org/linux/man-pages/man2/sigprocmask.2.html) and [signal(7)](http://man7.org/linux/man-pages/man7/signal.7.html) manual pages – Chris Dodd Feb 05 '19 at 18:09

0 Answers0