.TH sigprocmask() "" "" "System Call (libc)"
.PC "Examine or change the signal mask"
.B "#include <signal.h>"
\fBint sigprocmask(\fIhow\^\fB, \fIset\^\fB, \fIold_set\^\fB)\fR
\fBint \fIhow\^\fB; const sigset_t *\fIset\^\fB; sigset_t *\fIold_set\^\fB;\fR
.PP
.B sigprocmask()
examines or changes the calling process's signal mask.
.PP
.I how
defines how to modify the mask, as follows:
.IP \fBSIG_BLOCK\fR
Add to the signal mask the set of signals to which
.I set
points.
.IP \fBSIG_UNBLOCK\fR
Remove from the signal mask the set of signals to which
.I set
points.
.IP \fBSIG_SETMASK\fR
Replace the current signal mask with the set of signals to which
.I set
points.
If
.I old_set
is not NULL,
.B sigprocmask()
stores the old mask in the space to which it points.
.PP
If
.I set
is NULL,
.B sigprocmask()
ignores the value of
.IR how ;
thus, you can use the call to find which signals are in the signal mask.
.PP
If any unblocked unblocked signals are pending after you call
.BR sigprocmask() ,
at least one of those signals will be delivered before
.B sigprocmask()
returns.
.PP
If all goes well,
.B sigprocmask()
returns zero.
.B sigprocmask()
returns \-1 if either of the following conditions is true:
.IP \(bu 0.3i
.I how
is not set to a recognized value.
.B sigprocmask()
sets
.B errno
to
.BR EINVAL .
.IP \(bu
.I set
or
.I old_set
points outside the process's allocated address space.
.B sigprocmask()
sets
.B errno
to
.BR EFAULT .
.PP
In either error condition,
.B sigprocmask()
does not change the signal mask.
.SH "See Also"
.Xr "libc," libc
.Xr "signal()," signal
.Xr "siglongjmp()," siglongjm
.Xr "sigsetjmp()" sigsetjmp
.br
\*(PX Standard, \(sc3.3.5
