@node setjmp, misc @findex setjmp @subheading Syntax @example #include int setjmp(jmp_buf j); @end example @subheading Description This function stores the complete CPU state into @var{j}. This information is complete enough that @code{longjmp} (@pxref{longjmp}) can return the program to that state. It is also complete enough to implement coroutines. @subheading 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. @subheading Portability @portability ansi, posix @subheading Example @example jmp_buf j; if (setjmp(j)) return; do_something(); longjmp(j, 1); @end example