sigpause(3)
π sigpause(3) β the "please don't, bestie" page π
okay so real talk, this page lives in the Library Functions Manual, and it's here to gently (dramatically) tell you to close the tab. but like, you asked, so here's the whole thing, no cap. π«Ά
β¨ NAME β¨
sigpause β atomically release blocked signals and wait for interrupt
π LIBRARY π
Standard C library (libc, -lc)
πΈ SYNOPSIS πΈ
#include <signal.h>
[[deprecated]] int sigpause(int sigmask); /* BSD (but see VERSIONS) */
[[deprecated]] int sigpause(int sig); /* POSIX.1 / SysV / UNIX 95 */
π DESCRIPTION π
Don't use this function. Use sigsuspend(2) instead. that's it, that's the whole message, i'm not even joking π
okay but for real, here's what it does, so you know exactly why you're dodging it:
sigpause() is designed to wait for some signal. it changes the process's signal mask (aka the set of blocked signals), and then it waits for a signal to arrive. and the moment a signal shows up? the original signal mask gets restored. iconic behaviour, honestly, but sigsuspend(2) does it better and isn't deprecated, so π
π RETURN VALUE π
if sigpause() returns, it was interrupted by a signal, and the return value is -1 with errno set to EINTR. that's the only exit door, bestie. the only one.
π ATTRIBUTES π
for the whole explanation of what these terms even mean, go peek at attributes(7). β¨
here's the vibe check on sigpause():
- Interface:
sigpause()- Attribute: Thread safety
- Value:
MT-Safe
so like, thread-safe, at least. small wins. π«Ά
π¦ VERSIONS π¦
- On Linux, this routine is a system call only on the Sparc (
sparc64) architecture. everywhere else it's just vibing as a libc thing. - glibc uses the BSD version if the
_BSD_SOURCEfeature test macro is defined and none of_POSIX_SOURCE,_POSIX_C_SOURCE,_XOPEN_SOURCE,_GNU_SOURCE, or_SVID_SOURCEis defined. - otherwise, the System V version is used, and feature test macros must be defined as follows to obtain the declaration:
- Since glibc 2.26:
_XOPEN_SOURCE >= 500 - glibc 2.25 and earlier:
_XOPEN_SOURCE
and since glibc 2.19, only the System V version is exposed by <signal.h>. applications that formerly used the BSD sigpause() should be amended to use sigsuspend(2). like, amended please, it's for your own good π
β STANDARDS β
POSIX.1-2008.
π HISTORY π
POSIX.1-2001. obsoleted inPOSIX.1-2008. so yeah, it's giving β¨legacyβ¨- the classical BSD version of this function appeared in 4.2BSD. it sets the process's signal mask to
sigmask. - UNIX 95 standardized the incompatible System V version, which removes only the specified signal
sigfrom the process's signal mask. two different functions, same name, absolutely incompatible. not the serve anyone wanted π - that whole unfortunate situation β two incompatible functions with the same name β was solved by the
sigsuspend(2)function, which takes asigset_t *argument (instead of anint). and that's the happy ending, periodt. π
π₯ SEE ALSO π₯
kill(2), sigaction(2), sigprocmask(2), sigsuspend(2), sigblock(3), sigvec(3), feature_test_macros(7)
and that's the whole page, bestie π this little writeup comes from Linux man-pages 6.20, dated 2026-02-08, page sigpause(3). go use sigsuspend(2), ily, bye! π«Άβ¨
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 2004, Andries E. Brouwer <aeb@cwi.nl>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms