]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (C) 2004 Andries Brouwer (aeb@cwi.nl) |
2 | .\" | |
5fbde956 | 3 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da | 4 | .\" |
4c1c5274 | 5 | .TH sigpause 3 (date) "Linux man-pages (unreleased)" |
fea681da MK |
6 | .SH NAME |
7 | sigpause \- atomically release blocked signals and wait for interrupt | |
90265d55 AC |
8 | .SH LIBRARY |
9 | Standard C library | |
8fc3b2cf | 10 | .RI ( libc ", " \-lc ) |
fea681da MK |
11 | .SH SYNOPSIS |
12 | .nf | |
13 | .B #include <signal.h> | |
68e4db0a | 14 | .PP |
0588c9a3 | 15 | .BI "int sigpause(int " sigmask "); /* BSD (but see NOTES) */" |
68e4db0a | 16 | .PP |
008f1ecc | 17 | .BI "int sigpause(int " sig "); /* System V / UNIX 95 */" |
fea681da MK |
18 | .fi |
19 | .SH DESCRIPTION | |
c13182ef MK |
20 | Don't use this function. |
21 | Use | |
fea681da MK |
22 | .BR sigsuspend (2) |
23 | instead. | |
dd3568a1 | 24 | .PP |
fea681da | 25 | The function |
e511ffb6 | 26 | .BR sigpause () |
fea681da | 27 | is designed to wait for some signal. |
40f54839 | 28 | It changes the process's signal mask (set of blocked signals), |
fea681da MK |
29 | and then waits for a signal to arrive. |
30 | Upon arrival of a signal, the original signal mask is restored. | |
47297adb | 31 | .SH RETURN VALUE |
fea681da | 32 | If |
e511ffb6 | 33 | .BR sigpause () |
fea681da MK |
34 | returns, it was interrupted by a signal and the return value is \-1 |
35 | with | |
36 | .I errno | |
37 | set to | |
38 | .BR EINTR . | |
9840d4da | 39 | .SH ATTRIBUTES |
112943f3 PH |
40 | For an explanation of the terms used in this section, see |
41 | .BR attributes (7). | |
c466875e MK |
42 | .ad l |
43 | .nh | |
112943f3 PH |
44 | .TS |
45 | allbox; | |
c466875e | 46 | lbx lb lb |
112943f3 PH |
47 | l l l. |
48 | Interface Attribute Value | |
49 | T{ | |
9840d4da | 50 | .BR sigpause () |
e6c9defd MK |
51 | T} Thread safety MT-Safe |
52 | .TE | |
c466875e MK |
53 | .hy |
54 | .ad | |
55 | .sp 1 | |
e6c9defd MK |
56 | .\" FIXME: The marking is different from that in the glibc manual, |
57 | .\" marking in glibc manual is more detailed: | |
58 | .\" | |
eabb7166 | 59 | .\" sigpause: MT-Unsafe race:sigprocmask/!bsd!linux |
e6c9defd | 60 | .\" |
eabb7166 | 61 | .\" glibc manual says /!linux!bsd indicate the preceding marker only applies |
4cf9fe6b | 62 | .\" when the underlying kernel is neither Linux nor a BSD kernel. |
e6c9defd | 63 | .\" So, it is safe in Linux kernel. |
3113c7f3 | 64 | .SH STANDARDS |
1b1a3c6e MK |
65 | The System V version of |
66 | .BR sigpause () | |
67 | is standardized in POSIX.1-2001. | |
244ceca4 | 68 | It is also specified in POSIX.1-2008, where it is marked obsolete. |
889829be MK |
69 | .SH NOTES |
70 | .SS History | |
fea681da | 71 | The classical BSD version of this function appeared in 4.2BSD. |
40f54839 | 72 | It sets the process's signal mask to |
fea681da | 73 | .IR sigmask . |
008f1ecc | 74 | UNIX 95 standardized the incompatible System V version of |
7145b9a9 | 75 | this function, which removes only the specified signal |
fea681da | 76 | .I sig |
fc7ba057 | 77 | from the process's signal mask. |
008f1ecc | 78 | .\" __xpg_sigpause: UNIX 95, spec 1170, SVID, SVr4, XPG |
fea681da MK |
79 | The unfortunate situation with two incompatible functions with the |
80 | same name was solved by the | |
81 | .BR \%sigsuspend (2) | |
82 | function, that takes a | |
5049da5b | 83 | .I "sigset_t\ *" |
c4bb193f | 84 | argument (instead of an |
40f54839 | 85 | .IR int ). |
c634028a | 86 | .SS Linux notes |
fea681da | 87 | On Linux, this routine is a system call only on the Sparc (sparc64) |
c13182ef | 88 | architecture. |
847e0d88 | 89 | .PP |
3f731493 | 90 | .\" Libc4 and libc5 know only about the BSD version. |
ef4f4031 | 91 | .\" |
db4e96b7 MK |
92 | Glibc uses the BSD version if the |
93 | .B _BSD_SOURCE | |
2f0af33b MK |
94 | feature test macro is defined and none of |
95 | .BR _POSIX_SOURCE , | |
96 | .BR _POSIX_C_SOURCE , | |
97 | .BR _XOPEN_SOURCE , | |
98 | .BR _GNU_SOURCE , | |
99 | or | |
c3dfd2c8 MK |
100 | .B _SVID_SOURCE |
101 | is defined. | |
2079d434 MK |
102 | Otherwise, the System V version is used, |
103 | and feature test macros must be defined as follows to obtain the declaration: | |
22356d97 | 104 | .IP \(bu 3 |
2079d434 MK |
105 | Since glibc 2.26: |
106 | _XOPEN_SOURCE >= 500 | |
107 | .\" || (_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) | |
22356d97 | 108 | .IP \(bu |
2079d434 MK |
109 | Glibc 2.25 and earlier: _XOPEN_SOURCE |
110 | .PP | |
0588c9a3 MK |
111 | Since glibc 2.19, only the System V version is exposed by |
112 | .IR <signal.h> ; | |
113 | applications that formerly used the BSD | |
114 | .BR sigpause () | |
115 | should be amended to use | |
116 | .BR sigsuspend (2). | |
988db661 | 117 | .\" |
fea681da MK |
118 | .\" For the BSD version, one usually uses a zero |
119 | .\" .I sigmask | |
120 | .\" to indicate that no signals are to be blocked. | |
47297adb | 121 | .SH SEE ALSO |
fea681da MK |
122 | .BR kill (2), |
123 | .BR sigaction (2), | |
fea681da MK |
124 | .BR sigprocmask (2), |
125 | .BR sigsuspend (2), | |
30ecea55 | 126 | .BR sigblock (3), |
98817d83 MK |
127 | .BR sigvec (3), |
128 | .BR feature_test_macros (7) |