1
by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages. |
1 |
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved |
2
by Francesco Paolo Lovergine
* Alligned to linux main manpages edition. |
2 |
.TH "SIGSETJMP" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual" |
1
by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages. |
3 |
.\" sigsetjmp |
4 |
.SH NAME |
|
5 |
sigsetjmp \- set jump point for a non-local goto
|
|
6 |
.SH SYNOPSIS |
|
7 |
.LP
|
|
8 |
\fB#include <setjmp.h>
|
|
9 |
.br
|
|
10 |
.sp
|
|
11 |
int sigsetjmp(sigjmp_buf\fP \fIenv\fP\fB, int\fP \fIsavemask\fP\fB); |
|
12 |
\fP
|
|
13 |
\fB
|
|
14 |
.br
|
|
15 |
\fP
|
|
16 |
.SH DESCRIPTION |
|
17 |
.LP
|
|
18 |
The \fIsigsetjmp\fP() function shall be equivalent to the \fIsetjmp\fP() |
|
19 |
function, |
|
20 |
except as follows: |
|
21 |
.IP " *" 3 |
|
22 |
References to \fIsetjmp\fP() are equivalent to \fIsigsetjmp\fP(). |
|
23 |
.LP
|
|
24 |
.IP " *" 3 |
|
25 |
References to \fIlongjmp\fP() are equivalent to \fIsiglongjmp\fP(). |
|
26 |
.LP
|
|
27 |
.IP " *" 3 |
|
28 |
If the value of the \fIsavemask\fP argument is not 0, \fIsigsetjmp\fP() |
|
29 |
shall also save the current signal mask of the calling |
|
30 |
thread as part of the calling environment. |
|
31 |
.LP
|
|
32 |
.SH RETURN VALUE |
|
33 |
.LP
|
|
34 |
If the return is from a successful direct invocation, \fIsigsetjmp\fP() |
|
35 |
shall return 0. If the return is from a call to \fIsiglongjmp\fP(), |
|
36 |
\fIsigsetjmp\fP() shall return a non-zero value. |
|
37 |
.SH ERRORS |
|
38 |
.LP
|
|
39 |
No errors are defined. |
|
40 |
.LP
|
|
41 |
\fIThe following sections are informative.\fP |
|
42 |
.SH EXAMPLES |
|
43 |
.LP
|
|
44 |
None. |
|
45 |
.SH APPLICATION USAGE |
|
46 |
.LP
|
|
47 |
The distinction between \fIsetjmp\fP()/ \fIlongjmp\fP() and \fIsigsetjmp\fP()/ |
|
48 |
\fIsiglongjmp\fP() is only significant for programs which use \fIsigaction\fP(), |
|
49 |
\fIsigprocmask\fP(), or \fIsigsuspend\fP(). |
|
50 |
.LP
|
|
51 |
Note that since this function is defined in terms of \fIsetjmp\fP(), |
|
52 |
if \fIsavemask\fP |
|
53 |
is zero, it is unspecified whether the signal mask is saved. |
|
54 |
.SH RATIONALE |
|
55 |
.LP
|
|
56 |
The ISO\ C standard specifies various restrictions on the usage of
|
|
57 |
the \fIsetjmp\fP() macro in order to permit implementors to recognize |
|
58 |
the name in the compiler and not |
|
59 |
implement an actual function. These same restrictions apply to the |
|
60 |
\fIsigsetjmp\fP() macro. |
|
61 |
.LP
|
|
62 |
There are processors that cannot easily support these calls, but this |
|
63 |
was not considered a sufficient reason to exclude |
|
64 |
them. |
|
65 |
.LP
|
|
66 |
4.2 BSD, 4.3 BSD, and XSI-conformant systems provide functions named |
|
67 |
\fI_setjmp\fP() |
|
68 |
and \fI_longjmp\fP() that, together with \fIsetjmp\fP() and \fIlongjmp\fP(), |
|
69 |
provide the same |
|
70 |
functionality as \fIsigsetjmp\fP() and \fIsiglongjmp\fP(). On those |
|
71 |
systems, \fIsetjmp\fP() and \fIlongjmp\fP() save and restore signal |
|
72 |
masks, while \fI_setjmp\fP() and \fI_longjmp\fP() do not. On System |
|
73 |
V Release 3 and in corresponding issues of the SVID, \fIsetjmp\fP() |
|
74 |
and \fIlongjmp\fP() are explicitly defined |
|
75 |
not to save and restore signal masks. In order to permit existing |
|
76 |
practice in both cases, the relation of \fIsetjmp\fP() and \fIlongjmp\fP() |
|
77 |
to signal masks is not |
|
78 |
specified, and a new set of functions is defined instead. |
|
79 |
.LP
|
|
80 |
The \fIlongjmp\fP() and \fIsiglongjmp\fP() |
|
81 |
functions operate as in the previous issue provided the matching \fIsetjmp\fP() |
|
82 |
or |
|
83 |
\fIsigsetjmp\fP() has been performed in the same thread. Non-local |
|
84 |
jumps into contexts saved by other threads would be at best a |
|
85 |
questionable practice and were not considered worthy of standardization. |
|
86 |
.SH FUTURE DIRECTIONS |
|
87 |
.LP
|
|
88 |
None. |
|
89 |
.SH SEE ALSO |
|
90 |
.LP
|
|
91 |
\fIsiglongjmp\fP() , \fIsignal\fP() , \fIsigprocmask\fP() , \fIsigsuspend\fP() |
|
92 |
, the Base Definitions volume of |
|
93 |
IEEE\ Std\ 1003.1-2001, \fI<setjmp.h>\fP |
|
94 |
.SH COPYRIGHT |
|
95 |
Portions of this text are reprinted and reproduced in electronic form |
|
96 |
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology |
|
97 |
-- Portable Operating System Interface (POSIX), The Open Group Base |
|
98 |
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of |
|
99 |
Electrical and Electronics Engineers, Inc and The Open Group. In the |
|
100 |
event of any discrepancy between this version and the original IEEE and |
|
101 |
The Open Group Standard, the original IEEE and The Open Group Standard |
|
102 |
is the referee document. The original Standard can be obtained online at |
|
103 |
http://www.opengroup.org/unix/online.html . |