.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved .TH "PTHREAD_SIGMASK" 3P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual" .\" pthread_sigmask .SH PROLOG This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. .SH NAME pthread_sigmask, sigprocmask \- examine and change blocked signals .SH SYNOPSIS .LP \fB#include .br .sp \fP .LP \fBint pthread_sigmask(int\fP \fIhow\fP\fB, const sigset_t *restrict\fP \fIset\fP\fB, .br \ \ \ \ \ \ sigset_t *restrict\fP \fIoset\fP\fB); .br \fP .LP \fBint sigprocmask(int\fP \fIhow\fP\fB, const sigset_t *restrict\fP \fIset\fP\fB, .br \ \ \ \ \ \ sigset_t *restrict\fP \fIoset\fP\fB); \fP \fB .br \fP .SH DESCRIPTION .LP The \fIpthread_sigmask\fP() function shall examine or change (or both) the calling thread's signal mask, regardless of the number of threads in the process. The function shall be equivalent to \fIsigprocmask\fP(), without the restriction that the call be made in a single-threaded process. .LP In a single-threaded process, the \fIsigprocmask\fP() function shall examine or change (or both) the signal mask of the calling thread. .LP If the argument \fIset\fP is not a null pointer, it points to a set of signals to be used to change the currently blocked set. .LP The argument \fIhow\fP indicates the way in which the set is changed, and the application shall ensure it consists of one of the following values: .TP 7 SIG_BLOCK The resulting set shall be the union of the current set and the signal set pointed to by \fIset\fP. .TP 7 SIG_SETMASK The resulting set shall be the signal set pointed to by \fIset\fP. .TP 7 SIG_UNBLOCK The resulting set shall be the intersection of the current set and the complement of the signal set pointed to by \fIset\fP. .sp .LP If the argument \fIoset\fP is not a null pointer, the previous mask shall be stored in the location pointed to by \fIoset\fP. If \fIset\fP is a null pointer, the value of the argument \fIhow\fP is not significant and the process' signal mask shall be unchanged; thus the call can be used to enquire about currently blocked signals. .LP If there are any pending unblocked signals after the call to \fIsigprocmask\fP(), at least one of those signals shall be delivered before the call to \fIsigprocmask\fP() returns. .LP It is not possible to block those signals which cannot be ignored. This shall be enforced by the system without causing an error to be indicated. .LP If any of the SIGFPE, SIGILL, SIGSEGV, or SIGBUS signals are generated while they are blocked, the result is undefined, unless the signal was generated by the \fIkill\fP() function, the \fIsigqueue\fP() function, or the \fIraise\fP() function. .LP If \fIsigprocmask\fP() fails, the thread's signal mask shall not be changed. .LP The use of the \fIsigprocmask\fP() function is unspecified in a multi-threaded process. .SH RETURN VALUE .LP Upon successful completion \fIpthread_sigmask\fP() shall return 0; otherwise, it shall return the corresponding error number. .LP Upon successful completion, \fIsigprocmask\fP() shall return 0; otherwise, -1 shall be returned, \fIerrno\fP shall be set to indicate the error, and the process' signal mask shall be unchanged. .SH ERRORS .LP The \fIpthread_sigmask\fP() and \fIsigprocmask\fP() functions shall fail if: .TP 7 .B EINVAL The value of the \fIhow\fP argument is not equal to one of the defined values. .sp .LP The \fIpthread_sigmask\fP() function shall not return an error code of [EINTR]. .LP \fIThe following sections are informative.\fP .SH EXAMPLES .LP None. .SH APPLICATION USAGE .LP None. .SH RATIONALE .LP When a process' signal mask is changed in a signal-catching function that is installed by \fIsigaction\fP(), the restoration of the signal mask on return from the signal-catching function overrides that change (see \fIsigaction\fP()). If the signal-catching function was installed with \fIsignal\fP(), it is unspecified whether this occurs. .LP See \fIkill\fP() for a discussion of the requirement on delivery of signals. .SH FUTURE DIRECTIONS .LP None. .SH SEE ALSO .LP \fIsigaction\fP(), \fIsigaddset\fP(), \fIsigdelset\fP(), \fIsigemptyset\fP(), \fIsigfillset\fP(), \fIsigismember\fP(), \fIsigpending\fP(), \fIsigqueue\fP(), \fIsigsuspend\fP(), the Base Definitions volume of IEEE\ Std\ 1003.1-2001, \fI\fP .SH COPYRIGHT Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .