1SETJMP(3) Library Functions Manual SETJMP(3)
2
3
4
6 setjmp, longjmp - non-local goto
7
9 #include <setjmp.h>
10
11 setjmp(env)
12 jmp_buf env;
13
14 longjmp(env, val)
15 jmp_buf env;
16
18 These routines are useful for dealing with errors and interrupts
19 encountered in a low-level subroutine of a program.
20
21 Setjmp saves its stack environment in env for later use by longjmp. It
22 returns value 0.
23
24 Longjmp restores the environment saved by the last call of setjmp. It
25 then returns in such a way that execution continues as if the call of
26 setjmp had just returned the value val to the function that invoked
27 setjmp, which must not itself have returned in the interim. All accesâ
28 sible data have values as of the time longjmp was called.
29
31 signal(2)
32
33
34
35 SETJMP(3)