]>
Commit | Line | Data |
---|---|---|
bfac9793 | 1 | .\" Copyright (c) 2005 Michael Kerrisk |
c13182ef | 2 | .\" based on earlier work by faith@cs.unc.edu and |
bfac9793 MK |
3 | .\" Mike Battersby <mib@deakin.edu.au> |
4 | .\" | |
93015253 | 5 | .\" %%%LICENSE_START(VERBATIM) |
bfac9793 MK |
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. | |
9 | .\" | |
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. | |
c13182ef | 14 | .\" |
bfac9793 MK |
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 | |
21 | .\" professionally. | |
c13182ef | 22 | .\" |
bfac9793 MK |
23 | .\" Formatted or processed versions of this manual, if unaccompanied by |
24 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 25 | .\" %%%LICENSE_END |
bfac9793 MK |
26 | .\" |
27 | .\" 2005-09-15, mtk, Created new page by splitting off from sigaction.2 | |
28 | .\" | |
4b8c67d9 | 29 | .TH SIGPENDING 2 2017-09-15 "Linux" "Linux Programmer's Manual" |
bfac9793 | 30 | .SH NAME |
78898dc7 | 31 | sigpending, rt_sigpending \- examine pending signals |
bfac9793 MK |
32 | .SH SYNOPSIS |
33 | .B #include <signal.h> | |
68e4db0a | 34 | .PP |
bfac9793 | 35 | .BI "int sigpending(sigset_t *" set ); |
68e4db0a | 36 | .PP |
0f200f07 MK |
37 | .in -4n |
38 | Feature Test Macro Requirements for glibc (see | |
39 | .BR feature_test_macros (7)): | |
40 | .in | |
68e4db0a | 41 | .PP |
0f200f07 MK |
42 | .ad l |
43 | .BR sigpending (): | |
cff459de | 44 | _POSIX_C_SOURCE |
0f200f07 | 45 | .ad b |
bfac9793 MK |
46 | .SH DESCRIPTION |
47 | .PP | |
48 | .BR sigpending () | |
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 | |
52 | .IR set . | |
47297adb | 53 | .SH RETURN VALUE |
bfac9793 MK |
54 | .BR sigpending () |
55 | returns 0 on success and \-1 on error. | |
947683f3 MK |
56 | In the event of an error, |
57 | .I errno | |
58 | is set to indicate the cause. | |
bfac9793 MK |
59 | .SH ERRORS |
60 | .TP | |
61 | .B EFAULT | |
0daa9e92 | 62 | .I set |
bfac9793 | 63 | points to memory which is not a valid part of the process address space. |
47297adb | 64 | .SH CONFORMING TO |
e3972883 | 65 | POSIX.1-2001, POSIX.1-2008. |
bfac9793 | 66 | .SH NOTES |
81551079 | 67 | See |
bfac9793 MK |
68 | .BR sigsetops (3) |
69 | for details on manipulating signal sets. | |
efeece04 | 70 | .PP |
7af75ade MK |
71 | If a signal is both blocked and has a disposition of "ignored", it is |
72 | .I not | |
73 | added to the mask of pending signals when generated. | |
efeece04 | 74 | .PP |
7acce9fb MK |
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 | |
472e8c79 | 77 | and the set of signals that is pending for the process as a whole; see |
7acce9fb | 78 | .BR signal (7). |
efeece04 | 79 | .PP |
a6b7b511 MK |
80 | A child created via |
81 | .BR fork (2) | |
82 | initially has an empty pending signal set; | |
83 | the pending signal set is preserved across an | |
84 | .BR execve (2). | |
78898dc7 | 85 | .\" |
0722a578 | 86 | .SS C library/kernel differences |
78898dc7 MK |
87 | The original Linux system call was named |
88 | .BR sigpending (). | |
89 | However, with the addition of real-time signals in Linux 2.2, | |
90 | the fixed-size, 32-bit | |
91 | .IR sigset_t | |
92 | argument supported by that system call was no longer fit for purpose. | |
93 | Consequently, a new system call, | |
94 | .BR rt_sigpending (), | |
95 | was added to support an enlarged | |
96 | .IR sigset_t | |
97 | type. | |
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 | |
101 | .IR set . | |
102 | .\" This argument is currently required to be less than or equal to | |
103 | .\" .IR sizeof(sigset_t) | |
104 | .\" (or the error | |
105 | .\" .B EINVAL | |
106 | .\" results). | |
107 | The glibc | |
108 | .BR sigpending () | |
109 | wrapper function hides these details from us, transparently calling | |
110 | .BR rt_sigpending () | |
111 | when the kernel provides it. | |
112 | .\" | |
81551079 MK |
113 | .SH BUGS |
114 | In versions of glibc up to and including 2.2.1, | |
115 | there is a bug in the wrapper function for | |
116 | .BR sigpending () | |
c13182ef | 117 | which means that information about pending real-time signals |
81551079 | 118 | is not correctly returned. |
47297adb | 119 | .SH SEE ALSO |
bfac9793 MK |
120 | .BR kill (2), |
121 | .BR sigaction (2), | |
122 | .BR signal (2), | |
123 | .BR sigprocmask (2), | |
124 | .BR sigsuspend (2), | |
125 | .BR sigsetops (3), | |
126 | .BR signal (7) |