1SIGSETJMP(3P)              POSIX Programmer's Manual             SIGSETJMP(3P)
2
3
4

PROLOG

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

NAME

12       sigsetjmp - set jump point for a non-local goto
13

SYNOPSIS

15       #include <setjmp.h>
16
17       int sigsetjmp(sigjmp_buf env, int savemask);
18
19

DESCRIPTION

21       The sigsetjmp() function shall be equivalent to the setjmp()  function,
22       except as follows:
23
24        * References to setjmp() are equivalent to sigsetjmp().
25
26        * References to longjmp() are equivalent to siglongjmp().
27
28        * If  the  value  of the savemask argument is not 0, sigsetjmp() shall
29          also save the current signal mask of the calling thread as  part  of
30          the calling environment.
31

RETURN VALUE

33       If the return is from a successful direct invocation, sigsetjmp() shall
34       return 0. If the return is from a  call  to  siglongjmp(),  sigsetjmp()
35       shall return a non-zero value.
36

ERRORS

38       No errors are defined.
39
40       The following sections are informative.
41

EXAMPLES

43       None.
44

APPLICATION USAGE

46       The  distinction  between  setjmp()/  longjmp()  and  sigsetjmp()/ sig‐
47       longjmp() is only significant for programs which use sigaction(),  sig‐
48       procmask(), or sigsuspend().
49
50       Note that since this function is defined in terms of setjmp(), if save‐
51       mask is zero, it is unspecified whether the signal mask is saved.
52

RATIONALE

54       The ISO C standard specifies various restrictions on the usage  of  the
55       setjmp() macro in order to permit implementors to recognize the name in
56       the compiler and not implement an actual function. These same  restric‐
57       tions apply to the sigsetjmp() macro.
58
59       There  are  processors that cannot easily support these calls, but this
60       was not considered a sufficient reason to exclude them.
61
62       4.2 BSD, 4.3 BSD, and XSI-conformant systems  provide  functions  named
63       _setjmp()  and  _longjmp()  that, together with setjmp() and longjmp(),
64       provide the same functionality  as  sigsetjmp()  and  siglongjmp().  On
65       those  systems,  setjmp()  and longjmp() save and restore signal masks,
66       while _setjmp() and _longjmp() do not. On System V  Release  3  and  in
67       corresponding issues of the SVID, setjmp() and longjmp() are explicitly
68       defined not to save and restore signal masks. In order to permit exist‐
69       ing  practice  in both cases, the relation of setjmp() and longjmp() to
70       signal masks is not specified, and a new set of  functions  is  defined
71       instead.
72
73       The  longjmp()  and  siglongjmp()  functions operate as in the previous
74       issue provided the matching setjmp() or sigsetjmp() has been  performed
75       in  the  same  thread.  Non-local  jumps  into  contexts saved by other
76       threads would be at best a questionable practice and were  not  consid‐
77       ered worthy of standardization.
78

FUTURE DIRECTIONS

80       None.
81

SEE ALSO

83       siglongjmp(),  signal(),  sigprocmask(), sigsuspend(), the Base Defini‐
84       tions volume of IEEE Std 1003.1-2001, <setjmp.h>
85
87       Portions of this text are reprinted and reproduced in  electronic  form
88       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
89       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
90       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
91       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
92       event of any discrepancy between this version and the original IEEE and
93       The Open Group Standard, the original IEEE and The Open Group  Standard
94       is  the  referee document. The original Standard can be obtained online
95       at http://www.opengroup.org/unix/online.html .
96
97
98
99IEEE/The Open Group                  2003                        SIGSETJMP(3P)
Impressum