sigsetjmp - set jump point for a non-local goto
#include <setjmp.h> int sigsetjmp(sigjmp_buf env, int savemask);
A call to sigsetjmp() saves the calling environment in its env argument for later use by siglongjmp(). It is unspecified whether sigsetjmp() is a macro or a function. If a macro definition is suppressed in order to access an actual function, or a program defines an external identifier with the name sigsetjmp the behaviour is undefined.
If the value of the savemask argument is not 0, sigsetjmp() will also save the current signal mask of the calling thread as part of the calling environment.
All accessible objects have values as of the time siglongjmp() was called, except that the values of objects of automatic storage duration which are local to the function containing the invocation of the corresponding sigsetjmp() which do not have volatile-qualified type and which are changed between the sigsetjmp() invocation and siglongjmp() call are indeterminate.
An invocation of sigsetjmp() must appear in one of the following contexts only:
- the entire controlling expression of a selection or iteration statement
- one operand of a relational or equality operator with the other operand an integral constant expression, with the resulting expression being the entire controlling expression of a selection or iteration statement
- the operand of a unary (!) operator with the resulting expression being the entire controlling expression of a selection or iteration
- the entire expression of an expression statement (possibly cast to void).
If the return is from a successful direct invocation, sigsetjmp() returns 0. If the return is from a call to siglongjmp(), sigsetjmp() returns a non-zero value.
No errors are defined.
The distinction between setjmp()/longjmp() and sigsetjmp()/siglongjmp() is only significant for programs which use sigaction(), sigprocmask() or sigsuspend().
siglongjmp(), signal(), sigprocmask(), sigsuspend(), <setjmp.h>.
Derived from the POSIX.1-1988 standard.