]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (C) 2004 Andries Brouwer (aeb@cwi.nl) |
2 | .\" | |
3 | .\" Permission is granted to make and distribute verbatim copies of this | |
4 | .\" manual provided the copyright notice and this permission notice are | |
5 | .\" preserved on all copies. | |
6 | .\" | |
7 | .\" Permission is granted to copy and distribute modified versions of this | |
8 | .\" manual under the conditions for verbatim copying, provided that the | |
9 | .\" entire resulting derived work is distributed under the terms of a | |
10 | .\" permission notice identical to this one. | |
c13182ef | 11 | .\" |
fea681da MK |
12 | .\" Since the Linux kernel and libraries are constantly changing, this |
13 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
14 | .\" responsibility for errors or omissions, or for damages resulting from | |
15 | .\" the use of the information contained herein. The author(s) may not | |
16 | .\" have taken the same level of care in the production of this manual, | |
17 | .\" which is licensed free of charge, as they might when working | |
18 | .\" professionally. | |
c13182ef | 19 | .\" |
fea681da MK |
20 | .\" Formatted or processed versions of this manual, if unaccompanied by |
21 | .\" the source, must acknowledge the copyright and authors of this work. | |
22 | .\" | |
4468d2b7 | 23 | .TH SIGPAUSE 3 2010-09-12 "Linux" "Linux Programmer's Manual" |
fea681da MK |
24 | .SH NAME |
25 | sigpause \- atomically release blocked signals and wait for interrupt | |
26 | .SH SYNOPSIS | |
27 | .nf | |
28 | .B #include <signal.h> | |
29 | .sp | |
30 | .BI "int sigpause(int " sigmask "); /* BSD */" | |
31 | .sp | |
008f1ecc | 32 | .BI "int sigpause(int " sig "); /* System V / UNIX 95 */" |
fea681da MK |
33 | .fi |
34 | .SH DESCRIPTION | |
c13182ef MK |
35 | Don't use this function. |
36 | Use | |
fea681da MK |
37 | .BR sigsuspend (2) |
38 | instead. | |
39 | .LP | |
40 | The function | |
e511ffb6 | 41 | .BR sigpause () |
fea681da | 42 | is designed to wait for some signal. |
40f54839 | 43 | It changes the process's signal mask (set of blocked signals), |
fea681da MK |
44 | and then waits for a signal to arrive. |
45 | Upon arrival of a signal, the original signal mask is restored. | |
47297adb | 46 | .SH RETURN VALUE |
fea681da | 47 | If |
e511ffb6 | 48 | .BR sigpause () |
fea681da MK |
49 | returns, it was interrupted by a signal and the return value is \-1 |
50 | with | |
51 | .I errno | |
52 | set to | |
53 | .BR EINTR . | |
1b1a3c6e MK |
54 | .SH CONFORMING TO |
55 | The System V version of | |
56 | .BR sigpause () | |
57 | is standardized in POSIX.1-2001. | |
889829be MK |
58 | .SH NOTES |
59 | .SS History | |
fea681da | 60 | The classical BSD version of this function appeared in 4.2BSD. |
40f54839 | 61 | It sets the process's signal mask to |
fea681da | 62 | .IR sigmask . |
008f1ecc | 63 | UNIX 95 standardized the incompatible System V version of |
7145b9a9 | 64 | this function, which removes only the specified signal |
fea681da | 65 | .I sig |
fc7ba057 | 66 | from the process's signal mask. |
008f1ecc | 67 | .\" __xpg_sigpause: UNIX 95, spec 1170, SVID, SVr4, XPG |
fea681da MK |
68 | The unfortunate situation with two incompatible functions with the |
69 | same name was solved by the | |
70 | .BR \%sigsuspend (2) | |
71 | function, that takes a | |
40f54839 | 72 | .I "sigset_t *" |
c4bb193f | 73 | argument (instead of an |
40f54839 | 74 | .IR int ). |
c634028a | 75 | .SS Linux notes |
fea681da | 76 | On Linux, this routine is a system call only on the Sparc (sparc64) |
c13182ef | 77 | architecture. |
98817d83 | 78 | |
c13182ef | 79 | Libc4 and libc5 only know about the BSD version. |
98817d83 | 80 | |
db4e96b7 MK |
81 | Glibc uses the BSD version if the |
82 | .B _BSD_SOURCE | |
2f0af33b MK |
83 | feature test macro is defined and none of |
84 | .BR _POSIX_SOURCE , | |
85 | .BR _POSIX_C_SOURCE , | |
86 | .BR _XOPEN_SOURCE , | |
87 | .BR _GNU_SOURCE , | |
88 | or | |
c3dfd2c8 MK |
89 | .B _SVID_SOURCE |
90 | is defined. | |
4468d2b7 | 91 | Otherwise, the System V version is used. |
988db661 | 92 | .\" |
fea681da MK |
93 | .\" For the BSD version, one usually uses a zero |
94 | .\" .I sigmask | |
95 | .\" to indicate that no signals are to be blocked. | |
47297adb | 96 | .SH SEE ALSO |
fea681da MK |
97 | .BR kill (2), |
98 | .BR sigaction (2), | |
fea681da MK |
99 | .BR sigprocmask (2), |
100 | .BR sigsuspend (2), | |
30ecea55 | 101 | .BR sigblock (3), |
98817d83 MK |
102 | .BR sigvec (3), |
103 | .BR feature_test_macros (7) |