void longjmp(jmp_buf env,
             int val);

longjmp restores the environment saved by setjmp in the corresponding env argument. If there has been no such invocation, or if the function containing the invocation of setjmp has terminated execution in the interim, the behavior of longjmp is undefined.

After longjmp is completed, program execution continues as if the corresponding invocation of setjmp had just returned the value specified by val.


longjmp cannot cause setjmp to return the value 0; if val is 0, setjmp returns the value 1.

Objects of automatic storage allocation that are local to the function containing the invocation of the corresponding setjmp that do not have volatile qualified type and have been changed between the setjmp invocation and this call are indeterminate.