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 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein. The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
27 .\" 2005-09-15, mtk, Created new page by splitting off from sigaction.2
29 .TH SIGPENDING 2 2016-03-15 "Linux" "Linux Programmer's Manual"
31 sigpending, rt_sigpending \- examine pending signals
33 .B #include <signal.h>
35 .BI "int sigpending(sigset_t *" set );
38 Feature Test Macro Requirements for glibc (see
39 .BR feature_test_macros (7)):
49 returns the set of signals that are pending for delivery to the calling
50 thread (i.e., the signals which have been raised while blocked).
51 The mask of pending signals is returned in
55 returns 0 on success and \-1 on error.
56 In the event of an error,
58 is set to indicate the cause.
63 points to memory which is not a valid part of the process address space.
65 POSIX.1-2001, POSIX.1-2008.
69 for details on manipulating signal sets.
71 If a signal is both blocked and has a disposition of "ignored", it is
73 added to the mask of pending signals when generated.
75 The set of signals that is pending for a thread
76 is the union of the set of signals that is pending for that thread
77 and the set of signals that is pending for the process as a whole; see
82 initially has an empty pending signal set;
83 the pending signal set is preserved across an
86 .SS C library/kernel differences
87 The original Linux system call was named
89 However, with the addition of real-time signals in Linux 2.2,
90 the fixed-size, 32-bit
92 argument supported by that system call was no longer fit for purpose.
93 Consequently, a new system call,
95 was added to support an enlarged
98 The new system call takes a second argument,
99 .IR "size_t sigsetsize" ,
100 which specifies the size in bytes of the signal set in
102 .\" This argument is currently required to be less than or equal to
103 .\" .IR sizeof(sigset_t)
109 wrapper function hides these details from us, transparently calling
111 when the kernel provides it.
114 In versions of glibc up to and including 2.2.1,
115 there is a bug in the wrapper function for
117 which means that information about pending real-time signals
118 is not correctly returned.