1 .\" Written by Michael Haardt, Fri Nov 25 14:51:42 MET 1994
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 .\" GNU General Public License for more details.
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, see
20 .\" <http://www.gnu.org/licenses/>.
22 .\" Added siglongjmp, Sun Mar 2 22:03:05 EST 1997, jrv@vanzandt.mv.com
23 .\" Modifications, Sun Feb 26 14:39:45 1995, faith@cs.unc.edu
25 .TH LONGJMP 3 2009-01-13 "" "Linux Programmer's Manual"
27 longjmp, siglongjmp \- nonlocal jump to a saved stack context
30 .B #include <setjmp.h>
32 .BI "void longjmp(jmp_buf " env ", int " val );
34 .BI "void siglongjmp(sigjmp_buf " env ", int " val );
38 Feature Test Macro Requirements for glibc (see
39 .BR feature_test_macros (7)):
43 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_C_SOURCE
48 are useful for dealing with errors
49 and interrupts encountered in a low-level subroutine of a program.
51 restores the environment saved by the last call of
53 with the corresponding \fIenv\fP argument.
56 is completed, program execution continues as if the
59 had just returned the value
62 cannot cause 0 to be returned.
65 is invoked with a second argument of 0, 1 will be returned instead.
70 except for the type of
71 its \fIenv\fP argument.
75 \fIenv\fP used a nonzero \fIsavesigs\fP flag,
77 also restores the signal mask that was saved by
80 These functions never return.
82 C89, C99, and POSIX.1-2001 specify
84 POSIX.1-2001 specifies
87 POSIX does not specify whether
89 will restore the signal context (see
91 for some more details).
92 If you want to portably save and restore signal masks, use
97 The values of automatic variables are unspecified after a call to
99 if they meet all the following criteria:
101 they are local to the function that made the corresponding
105 their values are changed between the calls to
111 they are not declared as
114 Analogous remarks apply for
120 make programs hard to
121 understand and maintain.
122 If possible an alternative should be used.