-> Click here to learn how to get live help <-
NAMElongjmp, siglongjmp - non-local jump to a saved stack context
void longjmp(jmp_buf env, int val); void siglongjmp(sigjmp_buf env, int val);
DESCRIPTIONfBlongjmp()fP and fBsetjmp()fP are useful for dealing with errors and interrupts encountered in a low-level subroutine of a program. fBlongjmp()fP restores the environment saved by the last call of fBsetjmp()fP with the corresponding fIenvfP argument. After fBlongjmp()fP is completed, program execution continues as if the corresponding call of fBsetjmp()fP had just returned the value fIvalfP. fBlongjmp()fP cannot cause 0 to be returned. If longjmp is invoked with a second argument of 0, 1 will be returned instead. fBsiglongjmp()fP is similar to fBlongjmp()fP except for the type of its fIenvfP argument. If the fBsigsetjmp()fP call that set this fIenvfP used a nonzero fIsavesigsfP flag, fBsiglongjmp()fP also restores the set of blocked signals.
RETURN VALUEThese functions never return.
NOTESPOSIX does not specify whether fBlongjmpfP will restore the signal context. If you want to save and restore signal masks, use fBsiglongjmpfP. fBlongjmp()fP and fBsiglongjmp()fP make programs hard to understand and maintain. If possible an alternative should be used.
SEE ALSOsetjmp(3), sigsetjmp(3)