1.\" $OpenBSD: pthread_sigmask.3,v 1.10 2013/06/05 03:44:50 tedu Exp $
2.\"
3.\"
4.\"  David Leonard, 1999. Public Domain.
5.\"
6.Dd $Mdocdate: June 5 2013 $
7.Dt PTHREAD_SIGMASK 3
8.Os
9.Sh NAME
10.Nm pthread_sigmask
11.Nd examine and/or change a thread's signal mask
12.Sh SYNOPSIS
13.In signal.h
14.Ft int
15.Fn pthread_sigmask "int how" "const sigset_t *set" "sigset_t *oset"
16.Sh DESCRIPTION
17The
18.Fn pthread_sigmask
19function examines and/or changes the calling thread's signal mask.
20.Pp
21If
22.Fa set
23is not
24.Dv NULL ,
25it specifies a set of signals to be modified, and
26.Fa how
27specifies what to set the signal mask to:
28.Bl -tag -width SIG_UNBLOCK
29.It Dv SIG_BLOCK
30Union of the current mask and
31.Fa set .
32.It Dv SIG_UNBLOCK
33Intersection of the current mask and the complement of
34.Fa set .
35.It Dv SIG_SETMASK
36.Fa set .
37.El
38.Pp
39If
40.Fa oset
41is not NULL, the previous signal mask is stored in the location pointed to by
42.Fa oset .
43.Pp
44.Dv SIGKILL
45and
46.Dv SIGSTOP
47cannot be blocked, and will be silently ignored if included in the signal mask.
48.Sh RETURN VALUES
49If successful,
50.Fn pthread_sigmask
51returns 0.
52Otherwise, an error is returned.
53.Sh ERRORS
54.Fn pthread_sigmask
55will fail if:
56.Bl -tag -width Er
57.It Bq Er EINVAL
58.Fa how
59is not one of the defined values.
60.El
61.Sh SEE ALSO
62.Xr sigaction 2 ,
63.Xr sigpending 2 ,
64.Xr sigprocmask 2 ,
65.Xr sigsuspend 2 ,
66.Xr pthreads 3 ,
67.Xr sigsetops 3
68.Sh STANDARDS
69.Fn pthread_sigmask
70conforms to
71.St -p1003.1-96 .
72