]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/sigprocmask.2
3439433ac0964697dde4c16466145b499a6d09a0
[thirdparty/man-pages.git] / man2 / sigprocmask.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 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" 2005-09-15, mtk, Created new page by splitting off from sigaction.2
26 .\"
27 .TH SIGPROCMASK 2 2005-09-15 "Linux 2.6.13" "Linux Programmer's Manual"
28 .SH NAME
29 sigprocmask \- examine and change blocked signals
30 .SH SYNOPSIS
31 .B #include <signal.h>
32 .sp
33 .BI "int sigprocmask(int " how ", const sigset_t *" set ,
34 .BI "sigset_t *" oldset );
35 .SH DESCRIPTION
36 .BR sigprocmask ()
37 is used to change the signal mask, the set of currently blocked signals.
38 The behaviour of the call is dependent on the value of
39 .IR how ,
40 as follows.
41 .RS
42 .TP
43 .B SIG_BLOCK
44 The set of blocked signals is the union of the current set and the
45 .I set
46 argument.
47 .TP
48 .B SIG_UNBLOCK
49 The signals in
50 .I set
51 are removed from the current set of blocked signals. It is legal to
52 attempt to unblock a signal which is not blocked.
53 .TP
54 .B SIG_SETMASK
55 The set of blocked signals is set to the argument
56 .IR set .
57 .RE
58 .PP
59 If
60 .I oldset
61 is non\-null, the previous value of the signal mask is stored in
62 .IR oldset .
63
64 If
65 .I set
66 is NULL, then the signal mask is unchanged (i.e.,
67 .I how
68 is ignored),
69 but the current value of the signal mask is nevertheless returned in
70 .IR oldset
71 (it it is not NULL).
72
73 The use of
74 .BR sigprocmask ()
75 is unspecified in a multithreaded process; see
76 .BR pthread_sigmask (3).
77 .SH "RETURN VALUE"
78 .BR sigprocmask ()
79 returns 0 on success and \-1 on error.
80 .SH ERRORS
81 .B EINVAL
82 The value specified in
83 .I how
84 was invalid.
85 .SH NOTES
86 It is not possible to block
87 .BR SIGKILL " or " SIGSTOP .
88 Attempts to do so are silently ignored.
89 .PP
90 If
91 .BR SIGBUS ,
92 .BR SIGFPE ,
93 .BR SIGILL ,
94 or
95 .BR SIGSEGV
96 are generated
97 while they are blocked, the result is undefined,
98 unless the signal was generated by the
99 .BR kill (2),
100 .BR sigqueue (2),
101 or
102 .BR raise (3).
103 .PP
104 See
105 .BR sigsetops (3)
106 for details on manipulating signal sets.
107 .SH "CONFORMING TO"
108 POSIX.1-2001.
109 .SH "SEE ALSO"
110 .BR kill (2),
111 .BR pause (2),
112 .BR sigaction (2),
113 .BR signal (2),
114 .BR sigpending (2),
115 .BR sigprocmask (2),
116 .BR sigqueue (2),
117 .BR sigsuspend (2),
118 .BR pthread_sigmask (3),
119 .BR sigsetops (3),
120 .BR signal (7)