]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (C) 2004 Andries Brouwer (aeb@cwi.nl) |
2 | .\" | |
93015253 | 3 | .\" %%%LICENSE_START(VERBATIM) |
fea681da MK |
4 | .\" Permission is granted to make and distribute verbatim copies of this |
5 | .\" manual provided the copyright notice and this permission notice are | |
6 | .\" preserved on all copies. | |
7 | .\" | |
8 | .\" Permission is granted to copy and distribute modified versions of this | |
9 | .\" manual under the conditions for verbatim copying, provided that the | |
10 | .\" entire resulting derived work is distributed under the terms of a | |
11 | .\" permission notice identical to this one. | |
c13182ef | 12 | .\" |
fea681da MK |
13 | .\" Since the Linux kernel and libraries are constantly changing, this |
14 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
15 | .\" responsibility for errors or omissions, or for damages resulting from | |
16 | .\" the use of the information contained herein. The author(s) may not | |
17 | .\" have taken the same level of care in the production of this manual, | |
18 | .\" which is licensed free of charge, as they might when working | |
19 | .\" professionally. | |
c13182ef | 20 | .\" |
fea681da MK |
21 | .\" Formatted or processed versions of this manual, if unaccompanied by |
22 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 23 | .\" %%%LICENSE_END |
fea681da | 24 | .\" |
4b8c67d9 | 25 | .TH SIGPAUSE 3 2017-09-15 "Linux" "Linux Programmer's Manual" |
fea681da MK |
26 | .SH NAME |
27 | sigpause \- atomically release blocked signals and wait for interrupt | |
28 | .SH SYNOPSIS | |
29 | .nf | |
30 | .B #include <signal.h> | |
68e4db0a | 31 | .PP |
0588c9a3 | 32 | .BI "int sigpause(int " sigmask "); /* BSD (but see NOTES) */" |
68e4db0a | 33 | .PP |
008f1ecc | 34 | .BI "int sigpause(int " sig "); /* System V / UNIX 95 */" |
fea681da MK |
35 | .fi |
36 | .SH DESCRIPTION | |
c13182ef MK |
37 | Don't use this function. |
38 | Use | |
fea681da MK |
39 | .BR sigsuspend (2) |
40 | instead. | |
dd3568a1 | 41 | .PP |
fea681da | 42 | The function |
e511ffb6 | 43 | .BR sigpause () |
fea681da | 44 | is designed to wait for some signal. |
40f54839 | 45 | It changes the process's signal mask (set of blocked signals), |
fea681da MK |
46 | and then waits for a signal to arrive. |
47 | Upon arrival of a signal, the original signal mask is restored. | |
47297adb | 48 | .SH RETURN VALUE |
fea681da | 49 | If |
e511ffb6 | 50 | .BR sigpause () |
fea681da MK |
51 | returns, it was interrupted by a signal and the return value is \-1 |
52 | with | |
53 | .I errno | |
54 | set to | |
55 | .BR EINTR . | |
9840d4da | 56 | .SH ATTRIBUTES |
112943f3 PH |
57 | For an explanation of the terms used in this section, see |
58 | .BR attributes (7). | |
59 | .TS | |
60 | allbox; | |
61 | lb lb lb | |
62 | l l l. | |
63 | Interface Attribute Value | |
64 | T{ | |
9840d4da | 65 | .BR sigpause () |
e6c9defd MK |
66 | T} Thread safety MT-Safe |
67 | .TE | |
68 | .\" FIXME: The marking is different from that in the glibc manual, | |
69 | .\" marking in glibc manual is more detailed: | |
70 | .\" | |
eabb7166 | 71 | .\" sigpause: MT-Unsafe race:sigprocmask/!bsd!linux |
e6c9defd | 72 | .\" |
eabb7166 | 73 | .\" glibc manual says /!linux!bsd indicate the preceding marker only applies |
4cf9fe6b | 74 | .\" when the underlying kernel is neither Linux nor a BSD kernel. |
e6c9defd | 75 | .\" So, it is safe in Linux kernel. |
1b1a3c6e MK |
76 | .SH CONFORMING TO |
77 | The System V version of | |
78 | .BR sigpause () | |
79 | is standardized in POSIX.1-2001. | |
244ceca4 | 80 | It is also specified in POSIX.1-2008, where it is marked obsolete. |
889829be MK |
81 | .SH NOTES |
82 | .SS History | |
fea681da | 83 | The classical BSD version of this function appeared in 4.2BSD. |
40f54839 | 84 | It sets the process's signal mask to |
fea681da | 85 | .IR sigmask . |
008f1ecc | 86 | UNIX 95 standardized the incompatible System V version of |
7145b9a9 | 87 | this function, which removes only the specified signal |
fea681da | 88 | .I sig |
fc7ba057 | 89 | from the process's signal mask. |
008f1ecc | 90 | .\" __xpg_sigpause: UNIX 95, spec 1170, SVID, SVr4, XPG |
fea681da MK |
91 | The unfortunate situation with two incompatible functions with the |
92 | same name was solved by the | |
93 | .BR \%sigsuspend (2) | |
94 | function, that takes a | |
5049da5b | 95 | .I "sigset_t\ *" |
c4bb193f | 96 | argument (instead of an |
40f54839 | 97 | .IR int ). |
c634028a | 98 | .SS Linux notes |
fea681da | 99 | On Linux, this routine is a system call only on the Sparc (sparc64) |
c13182ef | 100 | architecture. |
847e0d88 | 101 | .PP |
3f731493 | 102 | .\" Libc4 and libc5 know only about the BSD version. |
ef4f4031 | 103 | .\" |
db4e96b7 MK |
104 | Glibc uses the BSD version if the |
105 | .B _BSD_SOURCE | |
2f0af33b MK |
106 | feature test macro is defined and none of |
107 | .BR _POSIX_SOURCE , | |
108 | .BR _POSIX_C_SOURCE , | |
109 | .BR _XOPEN_SOURCE , | |
110 | .BR _GNU_SOURCE , | |
111 | or | |
c3dfd2c8 MK |
112 | .B _SVID_SOURCE |
113 | is defined. | |
2079d434 MK |
114 | Otherwise, the System V version is used, |
115 | and feature test macros must be defined as follows to obtain the declaration: | |
116 | .IP * 3 | |
117 | Since glibc 2.26: | |
118 | _XOPEN_SOURCE >= 500 | |
119 | .\" || (_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) | |
120 | .IP * | |
121 | Glibc 2.25 and earlier: _XOPEN_SOURCE | |
122 | .PP | |
0588c9a3 MK |
123 | Since glibc 2.19, only the System V version is exposed by |
124 | .IR <signal.h> ; | |
125 | applications that formerly used the BSD | |
126 | .BR sigpause () | |
127 | should be amended to use | |
128 | .BR sigsuspend (2). | |
988db661 | 129 | .\" |
fea681da MK |
130 | .\" For the BSD version, one usually uses a zero |
131 | .\" .I sigmask | |
132 | .\" to indicate that no signals are to be blocked. | |
47297adb | 133 | .SH SEE ALSO |
fea681da MK |
134 | .BR kill (2), |
135 | .BR sigaction (2), | |
fea681da MK |
136 | .BR sigprocmask (2), |
137 | .BR sigsuspend (2), | |
30ecea55 | 138 | .BR sigblock (3), |
98817d83 MK |
139 | .BR sigvec (3), |
140 | .BR feature_test_macros (7) |