sigsetjmp(3)
Name
sigsetjmp, siglongjmp − nonlocal goto
Syntax
#include <setjmp.h>
sigsetjmp(env, savemask)
sigjmp_buf env;
void siglongjmp(env, val)
sigjmp_buf env;
Description
These routines deal with errors and interrupts encountered in a low-level subroutine of a program.
The sigsetjmp subroutine saves its stack environment in env for later use by siglongjmp. It returns a value of 0. If the value of the savemask argument is not zero, the sigsetjmp subroutine also saves the process´ current signal mask as part of the calling environment.
The siglongjmp subroutine restores the environment saved by the last call of sigsetjmp with the supplied env buffer. If the env argument was initialized by a call to the sigsetjmp subroutine with a nonzero savemask argument, the siglongjmp subroutine restores the saved signal mask. It then returns in such a way that execution continues as if the call of sigsetjmp had just returned the value val to the subroutine that invoked sigsetjmp, which must not itself have returned in the interim. However, siglongjmp cannot cause sigsetjmp to return the value 0. If siglongjmp is invoked with a val of 0, sigsetjmp returns a value of 1. All accessible data have values as of the time siglongjmp was called.
Restrictions
The sigsetjmp subroutine does not save the current notion of whether the process is executing on the signal stack. When you invoke the siglongjmp subroutine, the signal stack is left in an incorrect state.