xref: /freebsd/share/man/man3/pthread_sigmask.3 (revision 4c089f4dffe2205b8c8833d43180fbde6d42d9e7)
14c089f4dSJason Evans.\" Copyright (C) 2000 Jason Evans <jasone@canonware.com>.
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
384c089f4dSJason Evans.Fd #include <signal.h>
394c089f4dSJason Evans.Ft int
404c089f4dSJason Evans.Fn pthread_sigmask "int how" "const sigset_t *set" "sigset_t *oset"
414c089f4dSJason Evans.Sh DESCRIPTION
424c089f4dSJason EvansThe
434c089f4dSJason Evans.Fn pthread_sigmask
444c089f4dSJason Evansfunction examines and/or changes the calling thread's signal mask.
454c089f4dSJason Evans.Pp
464c089f4dSJason EvansIf
474c089f4dSJason Evans.Fa set
484c089f4dSJason Evansis not
494c089f4dSJason Evans.Dv NULL ,
504c089f4dSJason Evansit specifies a set of signals to be modified, and
514c089f4dSJason Evans.Fa how
524c089f4dSJason Evansspecifies what to set the signal mask to:
534c089f4dSJason Evans.Bl -tag -width SIG_UNBLOCK
544c089f4dSJason Evans.It Dv SIG_BLOCK
554c089f4dSJason EvansUnion of the current mask and
564c089f4dSJason Evans.Fa set .
574c089f4dSJason Evans.It Dv SIG_UNBLOCK
584c089f4dSJason EvansIntersection of the current mask and the complement of
594c089f4dSJason Evans.Fa set .
604c089f4dSJason Evans.It Dv SIG_SETMASK
614c089f4dSJason Evans.Fa set .
624c089f4dSJason Evans.El
634c089f4dSJason Evans.Pp
644c089f4dSJason EvansIf
654c089f4dSJason Evans.Fa oset
664c089f4dSJason Evansis not NULL, the previous signal mask is stored in the location pointed to by
674c089f4dSJason Evans.Fa oset .
684c089f4dSJason Evans.Pp
694c089f4dSJason Evans.Dv SIGKILL
704c089f4dSJason Evansand
714c089f4dSJason Evans.Dv SIGSTOP
724c089f4dSJason Evanscannot be blocked, and will be silently ignored if included in the signal mask.
734c089f4dSJason Evans.Sh RETURN VALUES
744c089f4dSJason EvansIf successful,
754c089f4dSJason Evans.Fn pthread_sigmask
764c089f4dSJason Evansreturns 0.
774c089f4dSJason EvansOtherwise, an error is returned.
784c089f4dSJason Evans.Sh ERRORS
794c089f4dSJason Evans.Fn pthread_sigmask
804c089f4dSJason Evanswill fail if:
814c089f4dSJason Evans.Bl -tag -width Er
824c089f4dSJason Evans.It Bq Er EINVAL
834c089f4dSJason Evans.Fa how
844c089f4dSJason Evansis not one of the defined values.
854c089f4dSJason Evans.El
864c089f4dSJason Evans.Sh SEE ALSO
874c089f4dSJason Evans.Xr sigaction 2 ,
884c089f4dSJason Evans.Xr sigpending 2 ,
894c089f4dSJason Evans.Xr sigprocmask 2 ,
904c089f4dSJason Evans.Xr sigsetops 3 ,
914c089f4dSJason Evans.Xr sigsuspend 2
924c089f4dSJason Evans.Sh STANDARDS
934c089f4dSJason Evans.Fn pthread_sigmask
944c089f4dSJason Evansconforms to ISO/IEC 9945-1 ANSI/IEEE
954c089f4dSJason Evans.Pq Dq Tn POSIX
964c089f4dSJason EvansStd 1003.1 1996 Edition.
97