Description | sigsetjmp() saves its calling environment in the argument env for later use by the siglongjmp() function. sigsetjmp() is implemented as a macro.
If the value of savemask is not equal to 0, sigsetjmp() will also save the current signal mask of the process as part of the calling environment. If setjmp() were used, this would be lost. All accessible objects will have the same values as when longjmp() was called, except for the values of "automatic" objects, which are undefined under the following conditions: They are local to the function containing the corresponding setjmp() call. They are not of type volatile. They are changed between the setjmp invocation and the longjmp call.
sigsetjmp() may only be called in one of the following contexts:
as the entire controlling expression of a selection or iteration statement, e.g.: if (sigsetjmp(env, mask)) ...
as one operand of a relational operator with the other operand an integral constant expression, with the resulting expression being the entire controlling expression of a selection or iteration statement, e.g.: if (sigsetjmp(env, mask)==0) ...
as the operand of a unary "!" operator with the resulting expression being the entire controlling expression of a selection or iteration statement, e.g.: if (!sigsetjmp(env, mask) ...
as the entire expression of an expression statement (possibly cast to void ), e.g.: (void) sigsetjmp(env, mask);
If threads are used, then the function affects the process or a thread in the following manner: If the value of savemask is not equal to 0, sigsetjmp() also stores the current signal mask of the calling thread as part of the call environment. |
See also | siglongjmp() , signal() , sigprocmask() , sigsuspend() , setjmp.h , section “Signals”.
|