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