xref: /freebsd/share/man/man3/pthread_sigmask.3 (revision ba13377a7e91ef426307c5dafc89927f15e5e8cc)
1c5e7e03aSRuslan Ermilov.\" Copyright (C) 2000 Jason Evans <jasone@FreeBSD.org>.
24c089f4dSJason Evans.\" All rights reserved.
34c089f4dSJason Evans.\"
44c089f4dSJason Evans.\" Redistribution and use in source and binary forms, with or without
54c089f4dSJason Evans.\" modification, are permitted provided that the following conditions
64c089f4dSJason Evans.\" are met:
74c089f4dSJason Evans.\" 1. Redistributions of source code must retain the above copyright
84c089f4dSJason Evans.\"    notice(s), this list of conditions and the following disclaimer as
94c089f4dSJason Evans.\"    the first lines of this file unmodified other than the possible
104c089f4dSJason Evans.\"    addition of one or more copyright notices.
114c089f4dSJason Evans.\" 2. Redistributions in binary form must reproduce the above copyright
124c089f4dSJason Evans.\"    notice(s), this list of conditions and the following disclaimer in
134c089f4dSJason Evans.\"    the documentation and/or other materials provided with the
144c089f4dSJason Evans.\"    distribution.
154c089f4dSJason Evans.\"
164c089f4dSJason Evans.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
174c089f4dSJason Evans.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
184c089f4dSJason Evans.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
194c089f4dSJason Evans.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
204c089f4dSJason Evans.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
214c089f4dSJason Evans.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
224c089f4dSJason Evans.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
234c089f4dSJason Evans.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
244c089f4dSJason Evans.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
254c089f4dSJason Evans.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
264c089f4dSJason Evans.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
274c089f4dSJason Evans.\"
284c089f4dSJason Evans.\" $FreeBSD$
29*ba13377aSKonstantin Belousov.Dd February 19, 2011
304c089f4dSJason Evans.Dt PTHREAD_SIGMASK 3
314c089f4dSJason Evans.Os
324c089f4dSJason Evans.Sh NAME
334c089f4dSJason Evans.Nm pthread_sigmask
344c089f4dSJason Evans.Nd examine and/or change a thread's signal mask
354c089f4dSJason Evans.Sh LIBRARY
36ec7452f1SRuslan Ermilov.Lb libpthread
374c089f4dSJason Evans.Sh SYNOPSIS
3832eef9aeSRuslan Ermilov.In pthread.h
3932eef9aeSRuslan Ermilov.In signal.h
404c089f4dSJason Evans.Ft int
41*ba13377aSKonstantin Belousov.Fn pthread_sigmask "int how" "const sigset_t * restrict set" \
42*ba13377aSKonstantin Belousov    "sigset_t * restrict oset"
434c089f4dSJason Evans.Sh DESCRIPTION
444c089f4dSJason EvansThe
454c089f4dSJason Evans.Fn pthread_sigmask
464c089f4dSJason Evansfunction examines and/or changes the calling thread's signal mask.
474c089f4dSJason Evans.Pp
484c089f4dSJason EvansIf
494c089f4dSJason Evans.Fa set
504c089f4dSJason Evansis not
514c089f4dSJason Evans.Dv NULL ,
524c089f4dSJason Evansit specifies a set of signals to be modified, and
534c089f4dSJason Evans.Fa how
544c089f4dSJason Evansspecifies what to set the signal mask to:
554c089f4dSJason Evans.Bl -tag -width SIG_UNBLOCK
564c089f4dSJason Evans.It Dv SIG_BLOCK
574c089f4dSJason EvansUnion of the current mask and
584c089f4dSJason Evans.Fa set .
594c089f4dSJason Evans.It Dv SIG_UNBLOCK
604c089f4dSJason EvansIntersection of the current mask and the complement of
614c089f4dSJason Evans.Fa set .
624c089f4dSJason Evans.It Dv SIG_SETMASK
634c089f4dSJason Evans.Fa set .
644c089f4dSJason Evans.El
654c089f4dSJason Evans.Pp
664c089f4dSJason EvansIf
674c089f4dSJason Evans.Fa oset
684c089f4dSJason Evansis not NULL, the previous signal mask is stored in the location pointed to by
694c089f4dSJason Evans.Fa oset .
704c089f4dSJason Evans.Pp
714c089f4dSJason Evans.Dv SIGKILL
724c089f4dSJason Evansand
734c089f4dSJason Evans.Dv SIGSTOP
744c089f4dSJason Evanscannot be blocked, and will be silently ignored if included in the signal mask.
754c089f4dSJason Evans.Sh RETURN VALUES
764c089f4dSJason EvansIf successful,
774c089f4dSJason Evans.Fn pthread_sigmask
784c089f4dSJason Evansreturns 0.
794c089f4dSJason EvansOtherwise, an error is returned.
804c089f4dSJason Evans.Sh ERRORS
819d09157aSPhilippe CharnierThe
824c089f4dSJason Evans.Fn pthread_sigmask
839d09157aSPhilippe Charnierfunction will fail if:
844c089f4dSJason Evans.Bl -tag -width Er
854c089f4dSJason Evans.It Bq Er EINVAL
864c089f4dSJason Evans.Fa how
874c089f4dSJason Evansis not one of the defined values.
884c089f4dSJason Evans.El
894c089f4dSJason Evans.Sh SEE ALSO
904c089f4dSJason Evans.Xr sigaction 2 ,
914c089f4dSJason Evans.Xr sigpending 2 ,
924c089f4dSJason Evans.Xr sigprocmask 2 ,
935521ff5aSRuslan Ermilov.Xr sigsuspend 2 ,
945521ff5aSRuslan Ermilov.Xr sigsetops 3
954c089f4dSJason Evans.Sh STANDARDS
969d09157aSPhilippe CharnierThe
974c089f4dSJason Evans.Fn pthread_sigmask
989d09157aSPhilippe Charnierfunction conforms to
99589a5e34SRuslan Ermilov.St -p1003.1-96
100