1 .\" Copyright (C) 2004 Andries Brouwer (aeb@cwi.nl)
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .TH sigpause 3 (date) "Linux man-pages (unreleased)"
7 sigpause \- atomically release blocked signals and wait for interrupt
10 .RI ( libc ", " \-lc )
13 .B #include <signal.h>
15 .BI "int sigpause(int " sigmask "); /* BSD (but see NOTES) */"
17 .BI "int sigpause(int " sig "); /* System V / UNIX 95 */"
20 Don't use this function.
27 is designed to wait for some signal.
28 It changes the process's signal mask (set of blocked signals),
29 and then waits for a signal to arrive.
30 Upon arrival of a signal, the original signal mask is restored.
34 returns, it was interrupted by a signal and the return value is \-1
40 For an explanation of the terms used in this section, see
48 Interface Attribute Value
51 T} Thread safety MT-Safe
56 .\" FIXME: The marking is different from that in the glibc manual,
57 .\" marking in glibc manual is more detailed:
59 .\" sigpause: MT-Unsafe race:sigprocmask/!bsd!linux
61 .\" glibc manual says /!linux!bsd indicate the preceding marker only applies
62 .\" when the underlying kernel is neither Linux nor a BSD kernel.
63 .\" So, it is safe in Linux kernel.
65 The System V version of
67 is standardized in POSIX.1-2001.
68 It is also specified in POSIX.1-2008, where it is marked obsolete.
71 The classical BSD version of this function appeared in 4.2BSD.
72 It sets the process's signal mask to
74 UNIX 95 standardized the incompatible System V version of
75 this function, which removes only the specified signal
77 from the process's signal mask.
78 .\" __xpg_sigpause: UNIX 95, spec 1170, SVID, SVr4, XPG
79 The unfortunate situation with two incompatible functions with the
80 same name was solved by the
82 function, that takes a
84 argument (instead of an
87 On Linux, this routine is a system call only on the Sparc (sparc64)
90 .\" Libc4 and libc5 know only about the BSD version.
92 Glibc uses the BSD version if the
94 feature test macro is defined and none of
102 Otherwise, the System V version is used,
103 and feature test macros must be defined as follows to obtain the declaration:
107 .\" || (_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED)
109 Glibc 2.25 and earlier: _XOPEN_SOURCE
111 Since glibc 2.19, only the System V version is exposed by
113 applications that formerly used the BSD
115 should be amended to use
118 .\" For the BSD version, one usually uses a zero
120 .\" to indicate that no signals are to be blocked.
128 .BR feature_test_macros (7)