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_SOURCE feature test macro is defined and none of _POSIX_SOURCE, _POSIX_C_SOURCE, _XOPEN_SOURCE, _GNU_SOURCE, or _SVID_SOURCE is 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 in POSIX.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 sig from 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 a sigset_t * argument (instead of an int). 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms