1PTHREAD_SIGMASK(P)         POSIX Programmer's Manual        PTHREAD_SIGMASK(P)
2
3
4

NAME

6       pthread_sigmask, sigprocmask - examine and change blocked signals
7

SYNOPSIS

9       #include <signal.h>
10
11
12
13       int pthread_sigmask(int how, const sigset_t *restrict set,
14              sigset_t *restrict oset);
15
16
17       int sigprocmask(int how, const sigset_t *restrict set,
18              sigset_t *restrict oset);
19
20

DESCRIPTION

22       The  pthread_sigmask()  function  shall examine or change (or both) the
23       calling thread's signal mask, regardless of the number  of  threads  in
24       the process. The function shall be equivalent to sigprocmask(), without
25       the restriction that the call be made in a single-threaded process.
26
27       In a single-threaded process, the sigprocmask() function shall  examine
28       or change (or both) the signal mask of the calling thread.
29
30       If  the  argument set is not a null pointer, it points to a set of sig‐
31       nals to be used to change the currently blocked set.
32
33       The argument how indicates the way in which the set is changed, and the
34       application shall ensure it consists of one of the following values:
35
36       SIG_BLOCK
37              The  resulting set shall be the union of the current set and the
38              signal set pointed to by set.
39
40       SIG_SETMASK
41              The resulting set shall be the signal set pointed to by set.
42
43       SIG_UNBLOCK
44              The resulting set shall be the intersection of the  current  set
45              and the complement of the signal set pointed to by set.
46
47
48       If  the argument oset is not a null pointer, the previous mask shall be
49       stored in the location pointed to by oset.  If set is a  null  pointer,
50       the  value of the argument how is not significant and the process' sig‐
51       nal mask shall be unchanged; thus the call can be used to enquire about
52       currently blocked signals.
53
54       If  there  are any pending unblocked signals after the call to sigproc‐
55       mask(), at least one of those signals shall  be  delivered  before  the
56       call to sigprocmask() returns.
57
58       It  is  not  possible  to  block those signals which cannot be ignored.
59       This shall be enforced by the system without causing  an  error  to  be
60       indicated.
61
62       If  any of the SIGFPE, SIGILL, SIGSEGV, or SIGBUS signals are generated
63       while they are blocked, the result is undefined, unless the signal  was
64       generated  by  the  kill()  function,  the  sigqueue() function, or the
65       raise() function.
66
67       If sigprocmask() fails, the thread's signal mask shall not be changed.
68
69       The use of the  sigprocmask()  function  is  unspecified  in  a  multi-
70       threaded process.
71

RETURN VALUE

73       Upon successful completion pthread_sigmask() shall return 0; otherwise,
74       it shall return the corresponding error number.
75
76       Upon successful completion, sigprocmask() shall return 0; otherwise, -1
77       shall  be  returned,  errno shall be set to indicate the error, and the
78       process' signal mask shall be unchanged.
79

ERRORS

81       The pthread_sigmask()  and sigprocmask() functions shall fail if:
82
83       EINVAL The value of the how argument is not equal to one of the defined
84              values.
85
86
87       The  pthread_sigmask()  function  shall  not  return  an  error code of
88       [EINTR].
89
90       The following sections are informative.
91

EXAMPLES

93       None.
94

APPLICATION USAGE

96       None.
97

RATIONALE

99       When a process' signal mask is changed in  a  signal-catching  function
100       that is installed by sigaction(), the restoration of the signal mask on
101       return from the signal-catching function  overrides  that  change  (see
102       sigaction()).  If  the signal-catching function was installed with sig‐
103       nal(), it is unspecified whether this occurs.
104
105       See kill() for a discussion of the requirement on delivery of signals.
106

FUTURE DIRECTIONS

108       None.
109

SEE ALSO

111       sigaction() , sigaddset() , sigdelset() , sigemptyset() ,  sigfillset()
112       ,  sigismember()  , sigpending() , sigqueue() , sigsuspend() , the Base
113       Definitions volume of IEEE Std 1003.1-2001, <signal.h>
114
116       Portions of this text are reprinted and reproduced in  electronic  form
117       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
118       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
119       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
120       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
121       event of any discrepancy between this version and the original IEEE and
122       The Open Group Standard, the original IEEE and The Open Group  Standard
123       is  the  referee document. The original Standard can be obtained online
124       at http://www.opengroup.org/unix/online.html .
125
126
127
128IEEE/The Open Group                  2003                   PTHREAD_SIGMASK(P)
Impressum