1sigpending(2) System Calls Manual sigpending(2)
2
3
4
6 sigpending, rt_sigpending - examine pending signals
7
9 Standard C library (libc, -lc)
10
12 #include <signal.h>
13
14 int sigpending(sigset_t *set);
15
16 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
17
18 sigpending():
19 _POSIX_C_SOURCE
20
22 sigpending() returns the set of signals that are pending for delivery
23 to the calling thread (i.e., the signals which have been raised while
24 blocked). The mask of pending signals is returned in set.
25
27 sigpending() returns 0 on success. On failure, -1 is returned and er‐
28 rno is set to indicate the error.
29
31 EFAULT set points to memory which is not a valid part of the process
32 address space.
33
35 POSIX.1-2008.
36
38 POSIX.1-2001.
39
40 C library/kernel differences
41 The original Linux system call was named sigpending(). However, with
42 the addition of real-time signals in Linux 2.2, the fixed-size, 32-bit
43 sigset_t argument supported by that system call was no longer fit for
44 purpose. Consequently, a new system call, rt_sigpending(), was added
45 to support an enlarged sigset_t type. The new system call takes a sec‐
46 ond argument, size_t sigsetsize, which specifies the size in bytes of
47 the signal set in set. The glibc sigpending() wrapper function hides
48 these details from us, transparently calling rt_sigpending() when the
49 kernel provides it.
50
52 See sigsetops(3) for details on manipulating signal sets.
53
54 If a signal is both blocked and has a disposition of "ignored", it is
55 not added to the mask of pending signals when generated.
56
57 The set of signals that is pending for a thread is the union of the set
58 of signals that is pending for that thread and the set of signals that
59 is pending for the process as a whole; see signal(7).
60
61 A child created via fork(2) initially has an empty pending signal set;
62 the pending signal set is preserved across an execve(2).
63
65 Up to and including glibc 2.2.1, there is a bug in the wrapper function
66 for sigpending() which means that information about pending real-time
67 signals is not correctly returned.
68
70 kill(2), sigaction(2), signal(2), sigprocmask(2), sigsuspend(2), sigse‐
71 tops(3), signal(7)
72
73
74
75Linux man-pages 6.05 2023-03-30 sigpending(2)