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.
|