setjmp Function

A macro that saves the current state of the program for later use by longjmp.

Include

<setjmp.h>

Prototype

#define setjmp(jmp_buf env)

Argument

env
variable where environment is stored

Return Value

If the return is from a direct call, setjmp returns zero. If the return is from a call to longjmp, setjmp returns a non-zero value.

Note: If the argument val from longjmp is 0, setjmp returns 1.

Example

See longjmp.