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, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
23 .\" Added siglongjmp, Sun Mar 2 22:03:05 EST 1997, jrv@vanzandt.mv.com
24 .\" Modifications, Sun Feb 26 14:39:45 1995, faith@cs.unc.edu
26 .TH LONGJMP 3 2009-01-13 "" "Linux Programmer's Manual"
28 longjmp, siglongjmp \- nonlocal jump to a saved stack context
31 .B #include <setjmp.h>
33 .BI "void longjmp(jmp_buf " env ", int " val );
35 .BI "void siglongjmp(sigjmp_buf " env ", int " val );
39 Feature Test Macro Requirements for glibc (see
40 .BR feature_test_macros (7)):
44 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_C_SOURCE
49 are useful for dealing with errors
50 and interrupts encountered in a low-level subroutine of a program.
52 restores the environment saved by the last call of
54 with the corresponding \fIenv\fP argument.
57 is completed, program execution continues as if the
60 had just returned the value
63 cannot cause 0 to be returned.
66 is invoked with a second argument of 0, 1 will be returned instead.
71 except for the type of
72 its \fIenv\fP argument.
76 \fIenv\fP used a nonzero \fIsavesigs\fP flag,
78 also restores the signal mask that was saved by
81 These functions never return.
83 C89, C99, and POSIX.1-2001 specify
85 POSIX.1-2001 specifies
88 POSIX does not specify whether
90 will restore the signal context (see
92 for some more details).
93 If you want to portably save and restore signal masks, use
98 The values of automatic variables are unspecified after a call to
100 if they meet all the following criteria:
102 they are local to the function that made the corresponding
106 their values are changed between the calls to
112 they are not declared as
115 Analogous remarks apply for
121 make programs hard to
122 understand and maintain.
123 If possible an alternative should be used.