1_LONGJMP(3P) POSIX Programmer's Manual _LONGJMP(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 _longjmp, _setjmp — non-local goto
13
15 #include <setjmp.h>
16
17 void _longjmp(jmp_buf env, int val);
18 int _setjmp(jmp_buf env);
19
21 The _longjmp() and _setjmp() functions shall be equivalent to longjmp()
22 and setjmp(), respectively, with the additional restriction that
23 _longjmp() and _setjmp() shall not manipulate the signal mask.
24
25 If _longjmp() is called even though env was never initialized by a call
26 to _setjmp(), or when the last such call was in a function that has
27 since returned, the results are undefined.
28
30 Refer to longjmp() and setjmp().
31
33 No errors are defined.
34
35 The following sections are informative.
36
38 None.
39
41 If _longjmp() is executed and the environment in which _setjmp() was
42 executed no longer exists, errors can occur. The conditions under which
43 the environment of the _setjmp() no longer exists include exiting the
44 function that contains the _setjmp() call, and exiting an inner block
45 with temporary storage. This condition might not be detectable, in
46 which case the _longjmp() occurs and, if the environment no longer
47 exists, the contents of the temporary storage of an inner block are
48 unpredictable. This condition might also cause unexpected process ter‐
49 mination. If the function has returned, the results are undefined.
50
51 Passing longjmp() a pointer to a buffer not created by setjmp(), pass‐
52 ing _longjmp() a pointer to a buffer not created by _setjmp(), passing
53 siglongjmp() a pointer to a buffer not created by sigsetjmp(), or pass‐
54 ing any of these three functions a buffer that has been modified by the
55 user can cause all the problems listed above, and more.
56
57 The _longjmp() and _setjmp() functions are included to support programs
58 written to historical system interfaces. New applications should use
59 siglongjmp() and sigsetjmp() respectively.
60
62 None.
63
65 The _longjmp() and _setjmp() functions may be removed in a future ver‐
66 sion.
67
69 longjmp(), setjmp(), siglongjmp(), sigsetjmp()
70
71 The Base Definitions volume of POSIX.1‐2017, <setjmp.h>
72
74 Portions of this text are reprinted and reproduced in electronic form
75 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
76 table Operating System Interface (POSIX), The Open Group Base Specifi‐
77 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
78 Electrical and Electronics Engineers, Inc and The Open Group. In the
79 event of any discrepancy between this version and the original IEEE and
80 The Open Group Standard, the original IEEE and The Open Group Standard
81 is the referee document. The original Standard can be obtained online
82 at http://www.opengroup.org/unix/online.html .
83
84 Any typographical or formatting errors that appear in this page are
85 most likely to have been introduced during the conversion of the source
86 files to man page format. To report such errors, see https://www.ker‐
87 nel.org/doc/man-pages/reporting_bugs.html .
88
89
90
91IEEE/The Open Group 2017 _LONGJMP(3P)