int setjmp(jmp_buf __jmpb)
setjmp() saves the stack context/environment in __jmpb for later use by longjmp(). The stack context will be invalidated if the function which called setjmp() returns.
Remember: setjmp() returns 0 if returning directly, and non-zero when returning from longjmp() using the saved context.