OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man2 / sigpending.2
1 .\" Copyright (c) 2005 Michael Kerrisk
2 .\" based on earlier work by faith@cs.unc.edu and
3 .\" Mike Battersby <mib@deakin.edu.au>
4 .\"
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.
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.
14 .\"
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.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" %%%LICENSE_END
26 .\"
27 .\" 2005-09-15, mtk, Created new page by splitting off from sigaction.2
28 .\"
29 .TH SIGPENDING 2 2013-12-11 "Linux" "Linux Programmer's Manual"
30 .SH NAME
31 sigpending \- examine pending signals
32 .SH SYNOPSIS
33 .B #include <signal.h>
34 .sp
35 .BI "int sigpending(sigset_t *" set );
36 .sp
37 .in -4n
38 Feature Test Macro Requirements for glibc (see
39 .BR feature_test_macros (7)):
40 .in
41 .sp
42 .ad l
43 .BR sigpending ():
44 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE
45 .ad b
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 .
53 .SH RETURN VALUE
54 .BR sigpending ()
55 returns 0 on success and \-1 on error.
56 In the event of an error,
57 .I errno
58 is set to indicate the cause.
59 .SH ERRORS
60 .TP
61 .B EFAULT
62 .I set
63 points to memory which is not a valid part of the process address space.
64 .SH CONFORMING TO
65 POSIX.1-2001.
66 .SH NOTES
67 See
68 .BR sigsetops (3)
69 for details on manipulating signal sets.
70
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.
74
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
78 .BR signal (7).
79
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).
85 .SH BUGS
86 In versions of glibc up to and including 2.2.1,
87 there is a bug in the wrapper function for
88 .BR sigpending ()
89 which means that information about pending real-time signals
90 is not correctly returned.
91 .SH SEE ALSO
92 .BR kill (2),
93 .BR sigaction (2),
94 .BR signal (2),
95 .BR sigprocmask (2),
96 .BR sigsuspend (2),
97 .BR sigsetops (3),
98 .BR signal (7)
99 .SH COLOPHON
100 This page is part of release 3.68 of the Linux
101 .I man-pages
102 project.
103 A description of the project,
104 information about reporting bugs,
105 and the latest version of this page,
106 can be found at
107 \%http://www.kernel.org/doc/man\-pages/.