setjmp(), _setjmp()

save information about calling environment 

Function


SYNOPSIS

#include <setjmp.h>

int setjmp(jmp_buf env);

int _setjmp(jmp_buf env);


DESCRIPTION

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 sigsetjmp().

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

An invocation of setjmp() must appear in one of the following contexts only:

The _setjmp() function behaves identically to setjmp().


PARAMETERS

env 

Is the buffer where the calling thread's environment is saved.


RETURN VALUES

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.


CONFORMANCE

setjmp(): ANSI/ISO 9899-1990, with exceptions

_setjmp(): UNIX 98, with exceptions.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

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


SEE ALSO

Functions:
_longjmp(), longjmp(), siglongjmp(), sigsetjmp()


PTC MKS Toolkit 10.2 Documentation Build 28.