1SIGPAUSE(3) Linux Programmer's Manual SIGPAUSE(3)
2
3
4
6 sigpause - atomically release blocked signals and wait for interrupt
7
9 #include <signal.h>
10
11 int sigpause(int sigmask); /* BSD (but see NOTES) */
12
13 int sigpause(int sig); /* System V / UNIX 95 */
14
16 Don't use this function. Use sigsuspend(2) instead.
17
18 The function sigpause() is designed to wait for some signal. It
19 changes the process's signal mask (set of blocked signals), and then
20 waits for a signal to arrive. Upon arrival of a signal, the original
21 signal mask is restored.
22
24 If sigpause() returns, it was interrupted by a signal and the return
25 value is -1 with errno set to EINTR.
26
28 For an explanation of the terms used in this section, see at‐
29 tributes(7).
30
31 ┌────────────────────────────────────────────┬───────────────┬─────────┐
32 │Interface │ Attribute │ Value │
33 ├────────────────────────────────────────────┼───────────────┼─────────┤
34 │sigpause() │ Thread safety │ MT-Safe │
35 └────────────────────────────────────────────┴───────────────┴─────────┘
36
38 The System V version of sigpause() is standardized in POSIX.1-2001. It
39 is also specified in POSIX.1-2008, where it is marked obsolete.
40
42 History
43 The classical BSD version of this function appeared in 4.2BSD. It sets
44 the process's signal mask to sigmask. UNIX 95 standardized the incom‐
45 patible System V version of this function, which removes only the spec‐
46 ified signal sig from the process's signal mask. The unfortunate situ‐
47 ation with two incompatible functions with the same name was solved by
48 the sigsuspend(2) function, that takes a sigset_t * argument (instead
49 of an int).
50
51 Linux notes
52 On Linux, this routine is a system call only on the Sparc (sparc64) ar‐
53 chitecture.
54
55 Glibc uses the BSD version if the _BSD_SOURCE feature test macro is de‐
56 fined and none of _POSIX_SOURCE, _POSIX_C_SOURCE, _XOPEN_SOURCE,
57 _GNU_SOURCE, or _SVID_SOURCE is defined. Otherwise, the System V ver‐
58 sion is used, and feature test macros must be defined as follows to ob‐
59 tain the declaration:
60
61 * Since glibc 2.26: _XOPEN_SOURCE >= 500
62
63 * Glibc 2.25 and earlier: _XOPEN_SOURCE
64
65 Since glibc 2.19, only the System V version is exposed by <signal.h>;
66 applications that formerly used the BSD sigpause() should be amended to
67 use sigsuspend(2).
68
70 kill(2), sigaction(2), sigprocmask(2), sigsuspend(2), sigblock(3),
71 sigvec(3), feature_test_macros(7)
72
74 This page is part of release 5.13 of the Linux man-pages project. A
75 description of the project, information about reporting bugs, and the
76 latest version of this page, can be found at
77 https://www.kernel.org/doc/man-pages/.
78
79
80
81Linux 2021-03-22 SIGPAUSE(3)