This function stores the complete CPU state into j. This
information is complete enough that longjmp (see section longjmp) can
return the program to that state. It is also complete enough to
implement coroutines.
Return Value
This function will return zero if it is returning from its own call.
If longjmp is used to restore the state, it will return whatever value
was passed to longjmp, except if zero is passed to longjmp it will
return one.
Portability
ANSI/ISO C
C89; C99
POSIX
1003.2-1992; 1003.1-2001
Example
jmp_buf j;
if (setjmp(j))
return;
do_something();
longjmp(j, 1);
Please take a moment to fill out
this visitor survey You can help support this site by
visiting the advertisers that sponsor it! (only once each, though)