sigpending(2)
โจ sigpending โ examine pending signals โจ
okay bestie, welcome to the sigpending(2) page, part of the System Calls Manual ๐ This is the one where you get to peek at which signals are like... waiting in the queue for your thread. Very main character of them, honestly.
๐ LIBRARY
Standard C library (libc, -lc) โ yeah she's a libc girlie ๐ซถ
๐ฆ SYNOPSIS
#include <signal.h>
int sigpending(sigset_t *set);
๐ธ Feature Test Macro Requirements for glibc (see feature_test_macros(7))
sigpending()โ you need_POSIX_C_SOURCEdefined. that's it, that's the requirement, periodt โจ
๐ DESCRIPTION
So like, sigpending() hands you back the set of signals that are pending for delivery to the calling thread. what does pending mean, bestie? it means they got raised while they were blocked. they're just sitting there, vibing, waiting their turn ๐ญ
The mask of pending signals gets returned in set. slay.
โญ RETURN VALUE
sigpending()returns0on success โ we LOVE a zero ๐ฅฐ- On failure it returns
-1, anderrnogets set to tell you what went wrong.
๐ ERRORS
EFAULTโsetpoints to memory that is not a valid part of the process address space. nope, not a real place, we can't go there ๐
๐ STANDARDS
POSIX.1-2024. iconic behavior, no notes.
๐ HISTORY
POSIX.1-2001. she's been around a while, lowkey a legend ๐
๐ง C library/kernel differences
okay so here's the tea โ The original Linux system call was named sigpending(). But then real-time signals showed up in Linux 2.2, and that fixed-size, 32-bit sigset_t argument the old syscall supported was no longer fit for purpose. it's giving "the old fit doesn't fit anymore" ๐ญ
So consequently, a new system call โ rt_sigpending() โ was added to support an enlarged sigset_t type. The new syscall takes a second argument, size_t sigsetsize, which specifies the size in bytes of the signal set in set.
And the glibc sigpending() wrapper function hides all of these details from us, transparently calling rt_sigpending() when the kernel provides it. so you just call the cute little function and glibc does the backstage work. king behavior fr fr ๐
๐ NOTES
- Peep
sigsetops(3)for the details on manipulating signal sets. that's where the real set-manipulation lore lives. - If a signal is both blocked and has a disposition of "ignored", it is not added to the mask of pending signals when it's generated. blocked + ignored = not invited to the pending party ๐
- The set of signals that is pending for a thread is the union of the set of signals pending for that thread and the set of signals pending for the process as a whole. see
signal(7)for the full picture. - A child created via
fork(2)initially has an empty pending signal set. fresh start, clean slate, new era โจ - The pending signal set is preserved across
execve(2). she survives the exec, resilient queen.
๐ BUGS
Up to and including glibc 2.2.1, there is a bug in the wrapper function for sigpending() which means that information about pending real-time signals is not correctly returned. so like, if you're on something ancient, the real-time pending info is just... wrong. not us fixing it, just telling you ๐
๐ SEE ALSO
kill(2), sigaction(2), signal(2), sigprocmask(2), sigsuspend(2), sigsetops(3), signal(7)
okay that's the whole page bestie, you're officially caught up ๐ซถ this was Linux man-pages 6.20, dated 2026-02-08, and yes she ate, no crumbs left. go check your pending signals, mwah ๐๐ธ
๐ฆ 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 2005, Michael Kerrisk <mtk.manpages@gmail.com>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms