~ubuntu-branches/ubuntu/precise/manpages-posix/precise

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 
.TH "PTHREAD_SIGMASK" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
.\" pthread_sigmask 
.SH NAME
pthread_sigmask, sigprocmask \- examine and change blocked signals
.SH SYNOPSIS
.LP
\fB#include <signal.h>
.br
.sp
\fP
.LP
\fBint pthread_sigmask(int\fP \fIhow\fP\fB, const sigset_t *restrict\fP
\fIset\fP\fB,
.br
\ \ \ \ \ \  sigset_t *restrict\fP \fIoset\fP\fB);
.br
\fP
.LP
\fBint sigprocmask(int\fP \fIhow\fP\fB, const sigset_t *restrict\fP
\fIset\fP\fB,
.br
\ \ \ \ \ \  sigset_t *restrict\fP \fIoset\fP\fB); \fP
\fB
.br
\fP
.SH DESCRIPTION
.LP
The \fIpthread_sigmask\fP() function shall examine or change (or both)
the calling thread's signal mask, regardless of the number
of threads in the process. The function shall be equivalent to \fIsigprocmask\fP(),
without the restriction that the call be made
in a single-threaded process. 
.LP
In a single-threaded process, the \fIsigprocmask\fP() function shall
examine or change (or both) the signal mask of the calling
thread.
.LP
If the argument \fIset\fP is not a null pointer, it points to a set
of signals to be used to change the currently blocked
set.
.LP
The argument \fIhow\fP indicates the way in which the set is changed,
and the application shall ensure it consists of one of
the following values:
.TP 7
SIG_BLOCK
The resulting set shall be the union of the current set and the signal
set pointed to by \fIset\fP.
.TP 7
SIG_SETMASK
The resulting set shall be the signal set pointed to by \fIset\fP.
.TP 7
SIG_UNBLOCK
The resulting set shall be the intersection of the current set and
the complement of the signal set pointed to by
\fIset\fP.
.sp
.LP
If the argument \fIoset\fP is not a null pointer, the previous mask
shall be stored in the location pointed to by \fIoset\fP.
If \fIset\fP is a null pointer, the value of the argument \fIhow\fP
is not significant and the process' signal mask shall be
unchanged; thus the call can be used to enquire about currently blocked
signals.
.LP
If there are any pending unblocked signals after the call to \fIsigprocmask\fP(),
at least one of those signals shall be
delivered before the call to \fIsigprocmask\fP() returns.
.LP
It is not possible to block those signals which cannot be ignored.
This shall be enforced by the system without causing an error
to be indicated.
.LP
If any of the SIGFPE, SIGILL, SIGSEGV, or SIGBUS signals are generated
while they are blocked, the result is undefined, unless
the signal was generated by the \fIkill\fP() function, the \fIsigqueue\fP()
function, or the \fIraise\fP()
function.
.LP
If \fIsigprocmask\fP() fails, the thread's signal mask shall not be
changed.
.LP
The use of the \fIsigprocmask\fP() function is unspecified in a multi-threaded
process.
.SH RETURN VALUE
.LP
Upon successful completion \fIpthread_sigmask\fP() shall return 0;
otherwise, it shall return the corresponding error number. 
.LP
Upon successful completion, \fIsigprocmask\fP() shall return 0; otherwise,
-1 shall be returned, \fIerrno\fP shall be set to
indicate the error, and the process' signal mask shall be unchanged.
.SH ERRORS
.LP
The \fIpthread_sigmask\fP()  and \fIsigprocmask\fP() functions
shall fail if:
.TP 7
.B EINVAL
The value of the \fIhow\fP argument is not equal to one of the defined
values.
.sp
.LP
The \fIpthread_sigmask\fP() function shall not return an error code
of [EINTR]. 
.LP
\fIThe following sections are informative.\fP
.SH EXAMPLES
.LP
None.
.SH APPLICATION USAGE
.LP
None.
.SH RATIONALE
.LP
When a process' signal mask is changed in a signal-catching function
that is installed by \fIsigaction\fP(), the restoration of the signal
mask on return from the signal-catching
function overrides that change (see \fIsigaction\fP()). If the signal-catching
function
was installed with \fIsignal\fP(), it is unspecified whether this
occurs.
.LP
See \fIkill\fP() for a discussion of the requirement on delivery of
signals.
.SH FUTURE DIRECTIONS
.LP
None.
.SH SEE ALSO
.LP
\fIsigaction\fP() , \fIsigaddset\fP() , \fIsigdelset\fP() , \fIsigemptyset\fP()
, \fIsigfillset\fP() , \fIsigismember\fP() , \fIsigpending\fP() ,
\fIsigqueue\fP() , \fIsigsuspend\fP() , the Base Definitions volume
of IEEE\ Std\ 1003.1-2001, \fI<signal.h>\fP
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. In the
event of any discrepancy between this version and the original IEEE and
The Open Group Standard, the original IEEE and The Open Group Standard
is the referee document. The original Standard can be obtained online at
http://www.opengroup.org/unix/online.html .