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