summaryrefslogtreecommitdiffstats
path: root/upstream/archlinux/man3p/_longjmp.3p
blob: ee9e8048f8eb6d37f280cecd4161e96c09e931b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
'\" et
.TH _LONGJMP "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
.\"
.SH PROLOG
This manual page is part of the POSIX Programmer's Manual.
The Linux implementation of this interface may differ (consult
the corresponding Linux manual page for details of Linux behavior),
or the interface may not be implemented on Linux.
.\"
.SH NAME
_longjmp,
_setjmp
\(em non-local goto
.SH SYNOPSIS
.LP
.nf
#include <setjmp.h>
.P
void _longjmp(jmp_buf \fIenv\fP, int \fIval\fP);
int _setjmp(jmp_buf \fIenv\fP);
.fi
.SH DESCRIPTION
The
\fI_longjmp\fR()
and
\fI_setjmp\fR()
functions shall be equivalent to
\fIlongjmp\fR()
and
\fIsetjmp\fR(),
respectively, with the additional restriction that
\fI_longjmp\fR()
and
\fI_setjmp\fR()
shall not manipulate the signal mask.
.P
If
\fI_longjmp\fR()
is called even though
.IR env
was never initialized by a call to
\fI_setjmp\fR(),
or when the last such call was in a function that has since returned,
the results are undefined.
.SH "RETURN VALUE"
Refer to
.IR "\fIlongjmp\fR\^(\|)"
and
.IR "\fIsetjmp\fR\^(\|)".
.SH ERRORS
No errors are defined.
.LP
.IR "The following sections are informative."
.SH EXAMPLES
None.
.SH "APPLICATION USAGE"
If
\fI_longjmp\fR()
is executed and the environment in which
\fI_setjmp\fR()
was executed no longer exists, errors can occur. The conditions under
which the environment of the
\fI_setjmp\fR()
no longer exists include exiting the function that contains the
\fI_setjmp\fR()
call, and exiting an inner block with temporary storage. This
condition might not be detectable, in which case the
\fI_longjmp\fR()
occurs and, if the environment no longer exists, the contents of the
temporary storage of an inner block are unpredictable. This condition
might also cause unexpected process termination. If the function has
returned, the results are undefined.
.P
Passing
\fIlongjmp\fR()
a pointer to a buffer not created by
\fIsetjmp\fR(),
passing
\fI_longjmp\fR()
a pointer to a buffer not created by
\fI_setjmp\fR(),
passing
\fIsiglongjmp\fR()
a pointer to a buffer not created by
\fIsigsetjmp\fR(),
or passing any of these three functions a buffer that has been modified
by the user can cause all the problems listed above, and more.
.P
The
\fI_longjmp\fR()
and
\fI_setjmp\fR()
functions are included to support programs written to historical system
interfaces. New applications should use
\fIsiglongjmp\fR()
and
\fIsigsetjmp\fR()
respectively.
.SH RATIONALE
None.
.SH "FUTURE DIRECTIONS"
The
\fI_longjmp\fR()
and
\fI_setjmp\fR()
functions may be removed in a future version.
.SH "SEE ALSO"
.IR "\fIlongjmp\fR\^(\|)",
.IR "\fIsetjmp\fR\^(\|)",
.IR "\fIsiglongjmp\fR\^(\|)",
.IR "\fIsigsetjmp\fR\^(\|)"
.P
The Base Definitions volume of POSIX.1\(hy2017,
.IR "\fB<setjmp.h>\fP"
.\"
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1-2017, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 7, 2018 Edition,
Copyright (C) 2018 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group.
In the event of any discrepancy between this version and the original IEEE and
The Open Group Standard, the original IEEE and The Open Group Standard
is the referee document. The original Standard can be obtained online at
http://www.opengroup.org/unix/online.html .
.PP
Any typographical or formatting errors that appear
in this page are most likely
to have been introduced during the conversion of the source files to
man page format. To report such errors, see
https://www.kernel.org/doc/man-pages/reporting_bugs.html .