1sigpause(3) Library Functions Manual sigpause(3)
2
3
4
6 sigpause - atomically release blocked signals and wait for interrupt
7
9 Standard C library (libc, -lc)
10
12 #include <signal.h>
13
14 [[deprecated]] int sigpause(int sigmask); /* BSD (but see NOTES) */
15
16 [[deprecated]] int sigpause(int sig); /* POSIX.1 / SysV / UNIX 95 */
17
19 Don't use this function. Use sigsuspend(2) instead.
20
21 The function sigpause() is designed to wait for some signal. It
22 changes the process's signal mask (set of blocked signals), and then
23 waits for a signal to arrive. Upon arrival of a signal, the original
24 signal mask is restored.
25
27 If sigpause() returns, it was interrupted by a signal and the return
28 value is -1 with errno set to EINTR.
29
31 For an explanation of the terms used in this section, see at‐
32 tributes(7).
33
34 ┌────────────────────────────────────────────┬───────────────┬─────────┐
35 │Interface │ Attribute │ Value │
36 ├────────────────────────────────────────────┼───────────────┼─────────┤
37 │sigpause() │ Thread safety │ MT-Safe │
38 └────────────────────────────────────────────┴───────────────┴─────────┘
39
41 On Linux, this routine is a system call only on the Sparc (sparc64)
42 architecture.
43
44 glibc uses the BSD version if the _BSD_SOURCE feature test macro is
45 defined and none of _POSIX_SOURCE, _POSIX_C_SOURCE, _XOPEN_SOURCE,
46 _GNU_SOURCE, or _SVID_SOURCE is defined. Otherwise, the System V
47 version is used, and feature test macros must be defined as follows to
48 obtain the declaration:
49
50 • Since glibc 2.26: _XOPEN_SOURCE >= 500
51
52 • glibc 2.25 and earlier: _XOPEN_SOURCE
53
54 Since glibc 2.19, only the System V version is exposed by <signal.h>;
55 applications that formerly used the BSD sigpause() should be amended to
56 use sigsuspend(2).
57
59 POSIX.1-2008.
60
62 POSIX.1-2001. Obsoleted in POSIX.1-2008.
63
64 The classical BSD version of this function appeared in 4.2BSD. It sets
65 the process's signal mask to sigmask. UNIX 95 standardized the
66 incompatible System V version of this function, which removes only the
67 specified signal sig from the process's signal mask. The unfortunate
68 situation with two incompatible functions with the same name was solved
69 by the sigsuspend(2) function, that takes a sigset_t * argument
70 (instead of an int).
71
73 kill(2), sigaction(2), sigprocmask(2), sigsuspend(2), sigblock(3),
74 sigvec(3), feature_test_macros(7)
75
76
77
78Linux man-pages 6.05 2023-07-20 sigpause(3)