xref: /freebsd/share/man/man3/pthread_sigmask.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
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.
27*ba13377aSKonstantin Belousov.Dd February 19, 2011
284c089f4dSJason Evans.Dt PTHREAD_SIGMASK 3
294c089f4dSJason Evans.Os
304c089f4dSJason Evans.Sh NAME
314c089f4dSJason Evans.Nm pthread_sigmask
324c089f4dSJason Evans.Nd examine and/or change a thread's signal mask
334c089f4dSJason Evans.Sh LIBRARY
34ec7452f1SRuslan Ermilov.Lb libpthread
354c089f4dSJason Evans.Sh SYNOPSIS
3632eef9aeSRuslan Ermilov.In pthread.h
3732eef9aeSRuslan Ermilov.In signal.h
384c089f4dSJason Evans.Ft int
39*ba13377aSKonstantin Belousov.Fn pthread_sigmask "int how" "const sigset_t * restrict set" \
40*ba13377aSKonstantin Belousov    "sigset_t * restrict 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
799d09157aSPhilippe CharnierThe
804c089f4dSJason Evans.Fn pthread_sigmask
819d09157aSPhilippe Charnierfunction will 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
949d09157aSPhilippe CharnierThe
954c089f4dSJason Evans.Fn pthread_sigmask
969d09157aSPhilippe Charnierfunction conforms to
97589a5e34SRuslan Ermilov.St -p1003.1-96
98