| 1 |
'\" t |
| 2 |
.\" Copyright 2004, Andries E. Brouwer <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 6 |
.\" |
| 7 |
.TH sigpause 3 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
sigpause \- atomically release blocked signals and wait for interrupt |
| 10 |
.SH LIBRARY |
| 11 |
Standard C library |
| 12 |
.RI ( libc ,\~ \-lc ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.B #include <signal.h> |
| 16 |
.P |
| 17 |
.BI "[[deprecated]] int sigpause(int " sigmask "); /* BSD (but see VERSIONS) */" |
| 18 |
.P |
| 19 |
.BI "[[deprecated]] int sigpause(int " sig "); /* POSIX.1 / SysV / UNIX 95 */" |
| 20 |
.fi |
| 21 |
.SH DESCRIPTION |
| 22 |
Don't use this function. |
| 23 |
Use |
| 24 |
.BR sigsuspend (2) |
| 25 |
instead. |
| 26 |
.P |
| 27 |
The function |
| 28 |
.BR sigpause () |
| 29 |
is designed to wait for some signal. |
| 30 |
It changes the process's signal mask (set of blocked signals), |
| 31 |
and then waits for a signal to arrive. |
| 32 |
Upon arrival of a signal, the original signal mask is restored. |
| 33 |
.SH RETURN VALUE |
| 34 |
If |
| 35 |
.BR sigpause () |
| 36 |
returns, it was interrupted by a signal and the return value is \-1 |
| 37 |
with |
| 38 |
.I errno |
| 39 |
set to |
| 40 |
.BR EINTR . |
| 41 |
.SH ATTRIBUTES |
| 42 |
For an explanation of the terms used in this section, see |
| 43 |
.BR attributes (7). |
| 44 |
.TS |
| 45 |
allbox; |
| 46 |
lbx lb lb |
| 47 |
l l l. |
| 48 |
Interface Attribute Value |
| 49 |
T{ |
| 50 |
.na |
| 51 |
.nh |
| 52 |
.BR sigpause () |
| 53 |
T} Thread safety MT-Safe |
| 54 |
.TE |
| 55 |
.\" FIXME: The marking is different from that in the glibc manual, |
| 56 |
.\" marking in glibc manual is more detailed: |
| 57 |
.\" |
| 58 |
.\" sigpause: MT-Unsafe race:sigprocmask/!bsd!linux |
| 59 |
.\" |
| 60 |
.\" glibc manual says /!linux!bsd indicate the preceding marker only applies |
| 61 |
.\" when the underlying kernel is neither Linux nor a BSD kernel. |
| 62 |
.\" So, it is safe in Linux kernel. |
| 63 |
.SH VERSIONS |
| 64 |
On Linux, this routine is a system call only on the Sparc (sparc64) |
| 65 |
architecture. |
| 66 |
.P |
| 67 |
.\" Libc4 and libc5 know only about the BSD version. |
| 68 |
.\" |
| 69 |
glibc uses the BSD version if the |
| 70 |
.B _BSD_SOURCE |
| 71 |
feature test macro is defined and none of |
| 72 |
.BR _POSIX_SOURCE , |
| 73 |
.BR _POSIX_C_SOURCE , |
| 74 |
.BR _XOPEN_SOURCE , |
| 75 |
.BR _GNU_SOURCE , |
| 76 |
or |
| 77 |
.B _SVID_SOURCE |
| 78 |
is defined. |
| 79 |
Otherwise, the System V version is used, |
| 80 |
and feature test macros must be defined as follows to obtain the declaration: |
| 81 |
.IP \[bu] 3 |
| 82 |
Since glibc 2.26: |
| 83 |
_XOPEN_SOURCE >= 500 |
| 84 |
.\" || (_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) |
| 85 |
.IP \[bu] |
| 86 |
glibc 2.25 and earlier: _XOPEN_SOURCE |
| 87 |
.P |
| 88 |
Since glibc 2.19, only the System V version is exposed by |
| 89 |
.IR <signal.h> ; |
| 90 |
applications that formerly used the BSD |
| 91 |
.BR sigpause () |
| 92 |
should be amended to use |
| 93 |
.BR sigsuspend (2). |
| 94 |
.\" |
| 95 |
.\" For the BSD version, one usually uses a zero |
| 96 |
.\" .I sigmask |
| 97 |
.\" to indicate that no signals are to be blocked. |
| 98 |
.SH STANDARDS |
| 99 |
POSIX.1-2008. |
| 100 |
.SH HISTORY |
| 101 |
POSIX.1-2001. |
| 102 |
Obsoleted in POSIX.1-2008. |
| 103 |
.P |
| 104 |
The classical BSD version of this function appeared in 4.2BSD. |
| 105 |
It sets the process's signal mask to |
| 106 |
.IR sigmask . |
| 107 |
UNIX 95 standardized the incompatible System V version of |
| 108 |
this function, which removes only the specified signal |
| 109 |
.I sig |
| 110 |
from the process's signal mask. |
| 111 |
.\" __xpg_sigpause: UNIX 95, spec 1170, SVID, SVr4, XPG |
| 112 |
The unfortunate situation with two incompatible functions with the |
| 113 |
same name was solved by the |
| 114 |
.BR \%sigsuspend (2) |
| 115 |
function, that takes a |
| 116 |
.I "sigset_t\ *" |
| 117 |
argument (instead of an |
| 118 |
.IR int ). |
| 119 |
.SH SEE ALSO |
| 120 |
.BR kill (2), |
| 121 |
.BR sigaction (2), |
| 122 |
.BR sigprocmask (2), |
| 123 |
.BR sigsuspend (2), |
| 124 |
.BR sigblock (3), |
| 125 |
.BR sigvec (3), |
| 126 |
.BR feature_test_macros (7) |