]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/sigpause.3
man*/: ffix (un-bracket tables)
[thirdparty/man-pages.git] / man3 / sigpause.3
CommitLineData
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
8sigpause \- atomically release blocked signals and wait for interrupt
90265d55
AC
9.SH LIBRARY
10Standard 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
21Don't use this function.
22Use
fea681da
MK
23.BR sigsuspend (2)
24instead.
dd3568a1 25.PP
fea681da 26The function
e511ffb6 27.BR sigpause ()
fea681da 28is designed to wait for some signal.
40f54839 29It changes the process's signal mask (set of blocked signals),
fea681da
MK
30and then waits for a signal to arrive.
31Upon arrival of a signal, the original signal mask is restored.
47297adb 32.SH RETURN VALUE
fea681da 33If
e511ffb6 34.BR sigpause ()
fea681da
MK
35returns, it was interrupted by a signal and the return value is \-1
36with
37.I errno
38set to
39.BR EINTR .
9840d4da 40.SH ATTRIBUTES
112943f3
PH
41For an explanation of the terms used in this section, see
42.BR attributes (7).
43.TS
44allbox;
c466875e 45lbx lb lb
112943f3
PH
46l l l.
47Interface Attribute Value
48T{
9e54434e
BR
49.na
50.nh
9840d4da 51.BR sigpause ()
e6c9defd
MK
52T} 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 64On Linux, this routine is a system call only on the Sparc (sparc64)
c13182ef 65architecture.
847e0d88 66.PP
3f731493 67.\" Libc4 and libc5 know only about the BSD version.
ef4f4031 68.\"
75c018a1 69glibc uses the BSD version if the
db4e96b7 70.B _BSD_SOURCE
2f0af33b
MK
71feature test macro is defined and none of
72.BR _POSIX_SOURCE ,
73.BR _POSIX_C_SOURCE ,
74.BR _XOPEN_SOURCE ,
75.BR _GNU_SOURCE ,
76or
c3dfd2c8
MK
77.B _SVID_SOURCE
78is defined.
2079d434
MK
79Otherwise, the System V version is used,
80and feature test macros must be defined as follows to obtain the declaration:
cdede5cd 81.IP \[bu] 3
2079d434
MK
82Since glibc 2.26:
83_XOPEN_SOURCE >= 500
84.\" || (_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED)
cdede5cd 85.IP \[bu]
75c018a1 86glibc 2.25 and earlier: _XOPEN_SOURCE
2079d434 87.PP
0588c9a3
MK
88Since glibc 2.19, only the System V version is exposed by
89.IR <signal.h> ;
90applications that formerly used the BSD
91.BR sigpause ()
92should 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
99POSIX.1-2008.
100.SH HISTORY
101POSIX.1-2001.
102Obsoleted in POSIX.1-2008.
103.PP
104The classical BSD version of this function appeared in 4.2BSD.
105It sets the process's signal mask to
106.IR sigmask .
107UNIX 95 standardized the incompatible System V version of
108this function, which removes only the specified signal
109.I sig
110from the process's signal mask.
111.\" __xpg_sigpause: UNIX 95, spec 1170, SVID, SVr4, XPG
112The unfortunate situation with two incompatible functions with the
113same name was solved by the
114.BR \%sigsuspend (2)
115function, that takes a
116.I "sigset_t\ *"
117argument (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)