int setjmp(jmp_buf env);
int _setjmp(jmp_buf env);
A call to setjmp() saves
the calling environment in its env parameter for later use
by longjmp(). The setjmp() function
does not save the calling thread's signal mask; refer to
When setjmp() returns
with a non-zero value, all accessible objects have values as of
the time longjmp() was called, except that the values of
objects of automatic duration which are local to the function
containing the invocation of the corresponding setjmp()
which are not declared volatile and which are changed between the
setjmp() invocation and longjmp() call
An invocation of setjmp()
must appear in one of the following contexts only:
- The entire controlling
expression of a selection or iteration statement.
- One operand of a relational or equality operator with the other operand
an integral constant expression, with the resulting
expression being the entire controlling expression of a
selection or iteration statement.
- The operand of a unary ! operator with
the resulting expressing being the entire controlling expression of a
selection or iteration.
- The entire expression of
an expression statement (possibly cast to void).
The _setjmp() function
behaves identically to setjmp().
Is the buffer where the calling thread's environment is saved.
If the return is from a direct invocation, setjmp()
returns 0. If the return is from a call to longjmp(),
setjmp() returns a non-zero value.
setjmp(): ANSI/ISO 9899-1990, with exceptions
_setjmp(): UNIX 98, with exceptions.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
- _longjmp(), longjmp(), siglongjmp(), sigsetjmp()
PTC MKS Toolkit 10.2 Documentation Build 28.