Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

siglongjmp - execute non-local jump using signal

&pagelevel(4)&pagelevel

Syntax

#include <setjmp.h>

void siglongjmp(sigjmp_buf env, int val);

Description

siglongjmp() restores the environment saved by the last invocation of sigsetjmp() in the same process with the same sigjmp_buf argument. If there is no prior invocation or if the function in which this macro was called has terminated in the interim, the behavior is undefined.

All accessible objects have the same values as of the time siglongjmp() was called, except that the values of automatic objects which are changed between the execution of sigsetjmp() and the siglongjmp() call are indeterminate.

Since siglongjmp() bypasses the usual function call and return mechanisms, it also executes correctly in contexts with interrupts, signals and their associated functions. However, if siglongjmp() is invoked from a nested signal handler (that is, from a function called as a result of a signal raised during another signal-handling function), the behavior is undefined.

siglongjmp() restores the saved signal mask if and only if the env argument was initialized by a call to sigsetjmp() with a savemask argument not equal to 0.

siglongjmp() is not thread-safe. The result of calling this function is undefined if the jmp_buf structure was not initialized in the calling thread. 

Return val.

0

After siglongjmp() is completed, program execution continues as if the corresponding execution of the sigsetjmp() macro had just returned the value specified by val. siglongjmp() cannot cause sigsetjmp() to return the value 0.

Notes

if val is 0, the corresponding sigsetjmp() macro returns the value 1. The distinction between setjmp() or longjmp() and sigsetjmp() or siglongjmp() is only significant for programs which use sigaction(), sigprocmask() or sigsuspend()

See also

longjmp(), setjmp(), sigprocmask(), sigsetjmp(), sigsuspend(), setjmp.h