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 .\" 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.
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.
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
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" 2005-09-15, mtk, Created new page by splitting off from sigaction.2
27 .TH SIGPROCMASK 2 2008-10-17 "Linux" "Linux Programmer's Manual"
29 sigprocmask \- examine and change blocked signals
31 .B #include <signal.h>
33 .BI "int sigprocmask(int " how ", const sigset_t *" set ,
34 .BI "sigset_t *" oldset );
37 Feature Test Macro Requirements for glibc (see
38 .BR feature_test_macros (7)):
43 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE
47 is used to fetch and/or change the signal mask of the calling thread.
48 The signal mask is the set of signals whose delivery is currently
49 blocked for the caller
54 The behavior of the call is dependent on the value of
59 The set of blocked signals is the union of the current set and the
66 are removed from the current set of blocked signals.
67 It is permissible to attempt to unblock a signal which is not blocked.
70 The set of blocked signals is set to the argument
75 is non-NULL, the previous value of the signal mask is stored in
80 is NULL, then the signal mask is unchanged (i.e.,
83 but the current value of the signal mask is nevertheless returned in
89 is unspecified in a multithreaded process; see
90 .BR pthread_sigmask (3).
93 returns 0 on success and \-1 on error.
96 The value specified in
102 It is not possible to block
103 .BR SIGKILL " or " SIGSTOP .
104 Attempts to do so are silently ignored.
106 Each of the threads in a process has its own signal mask.
110 inherits a copy of its parent's signal mask;
111 the signal mask is preserved across
121 while they are blocked, the result is undefined,
122 unless the signal was generated by
130 for details on manipulating signal sets.
139 .BR pthread_sigmask (3),