1 .\" Copyright (c) 2005 Michael Kerrisk
2 .\" based on earlier work by faith@cs.unc.edu and
3 .\" Mike Battersby <mib@deakin.edu.au>
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .\" 2005-09-15, mtk, Created new page by splitting off from sigaction.2
9 .TH SIGPENDING 2 2021-03-22 "Linux" "Linux Programmer's Manual"
11 sigpending, rt_sigpending \- examine pending signals
14 .RI ( libc ", " \-lc )
17 .B #include <signal.h>
19 .BI "int sigpending(sigset_t *" set );
23 Feature Test Macro Requirements for glibc (see
24 .BR feature_test_macros (7)):
33 returns the set of signals that are pending for delivery to the calling
34 thread (i.e., the signals which have been raised while blocked).
35 The mask of pending signals is returned in
40 On failure, \-1 is returned and
42 is set to indicate the error.
47 points to memory which is not a valid part of the process address space.
49 POSIX.1-2001, POSIX.1-2008.
53 for details on manipulating signal sets.
55 If a signal is both blocked and has a disposition of "ignored", it is
57 added to the mask of pending signals when generated.
59 The set of signals that is pending for a thread
60 is the union of the set of signals that is pending for that thread
61 and the set of signals that is pending for the process as a whole; see
66 initially has an empty pending signal set;
67 the pending signal set is preserved across an
70 .SS C library/kernel differences
71 The original Linux system call was named
73 However, with the addition of real-time signals in Linux 2.2,
74 the fixed-size, 32-bit
76 argument supported by that system call was no longer fit for purpose.
77 Consequently, a new system call,
79 was added to support an enlarged
82 The new system call takes a second argument,
83 .IR "size_t sigsetsize" ,
84 which specifies the size in bytes of the signal set in
86 .\" This argument is currently required to be less than or equal to
87 .\" .IR sizeof(sigset_t)
93 wrapper function hides these details from us, transparently calling
95 when the kernel provides it.
98 In versions of glibc up to and including 2.2.1,
99 there is a bug in the wrapper function for
101 which means that information about pending real-time signals
102 is not correctly returned.