xref: /freebsd/share/man/man3/pthread_sigmask.3 (revision c5e7e03a143ca33bf523994e766d62892780abcf)
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$
294c089f4dSJason Evans.Dd April 27, 2000
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
364c089f4dSJason Evans.Lb libc_r
374c089f4dSJason Evans.Sh SYNOPSIS
3827010737SBruce Evans.Fd #include <pthread.h>
394c089f4dSJason Evans.Fd #include <signal.h>
404c089f4dSJason Evans.Ft int
414c089f4dSJason Evans.Fn pthread_sigmask "int how" "const sigset_t *set" "sigset_t *oset"
424c089f4dSJason Evans.Sh DESCRIPTION
434c089f4dSJason EvansThe
444c089f4dSJason Evans.Fn pthread_sigmask
454c089f4dSJason Evansfunction examines and/or changes the calling thread's signal mask.
464c089f4dSJason Evans.Pp
474c089f4dSJason EvansIf
484c089f4dSJason Evans.Fa set
494c089f4dSJason Evansis not
504c089f4dSJason Evans.Dv NULL ,
514c089f4dSJason Evansit specifies a set of signals to be modified, and
524c089f4dSJason Evans.Fa how
534c089f4dSJason Evansspecifies what to set the signal mask to:
544c089f4dSJason Evans.Bl -tag -width SIG_UNBLOCK
554c089f4dSJason Evans.It Dv SIG_BLOCK
564c089f4dSJason EvansUnion of the current mask and
574c089f4dSJason Evans.Fa set .
584c089f4dSJason Evans.It Dv SIG_UNBLOCK
594c089f4dSJason EvansIntersection of the current mask and the complement of
604c089f4dSJason Evans.Fa set .
614c089f4dSJason Evans.It Dv SIG_SETMASK
624c089f4dSJason Evans.Fa set .
634c089f4dSJason Evans.El
644c089f4dSJason Evans.Pp
654c089f4dSJason EvansIf
664c089f4dSJason Evans.Fa oset
674c089f4dSJason Evansis not NULL, the previous signal mask is stored in the location pointed to by
684c089f4dSJason Evans.Fa oset .
694c089f4dSJason Evans.Pp
704c089f4dSJason Evans.Dv SIGKILL
714c089f4dSJason Evansand
724c089f4dSJason Evans.Dv SIGSTOP
734c089f4dSJason Evanscannot be blocked, and will be silently ignored if included in the signal mask.
744c089f4dSJason Evans.Sh RETURN VALUES
754c089f4dSJason EvansIf successful,
764c089f4dSJason Evans.Fn pthread_sigmask
774c089f4dSJason Evansreturns 0.
784c089f4dSJason EvansOtherwise, an error is returned.
794c089f4dSJason Evans.Sh ERRORS
804c089f4dSJason Evans.Fn pthread_sigmask
814c089f4dSJason Evanswill fail if:
824c089f4dSJason Evans.Bl -tag -width Er
834c089f4dSJason Evans.It Bq Er EINVAL
844c089f4dSJason Evans.Fa how
854c089f4dSJason Evansis not one of the defined values.
864c089f4dSJason Evans.El
874c089f4dSJason Evans.Sh SEE ALSO
884c089f4dSJason Evans.Xr sigaction 2 ,
894c089f4dSJason Evans.Xr sigpending 2 ,
904c089f4dSJason Evans.Xr sigprocmask 2 ,
915521ff5aSRuslan Ermilov.Xr sigsuspend 2 ,
925521ff5aSRuslan Ermilov.Xr sigsetops 3
934c089f4dSJason Evans.Sh STANDARDS
944c089f4dSJason Evans.Fn pthread_sigmask
952a53c5ecSAlexey Zelkinconforms to
96589a5e34SRuslan Ermilov.St -p1003.1-96
97