[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


pthread_sigmask

Examine or change the current thread's signal mask.

This routine is for Digital UNIX systems only.

Syntax

pthread_sigmask(
                how,
                set,
                oset );
 


Argument Data Type Access

how integer read set sigset_t read oset sigset_t write


C Binding

#include 

int pthread_sigmask ( int how, const sigset_t *set, sigset_t *oset);

Arguments

how
Indicates the manner in which the set of masked signals is changed. The optional values are as follows:
   SIG_BLOCK     The resulting set is the union of the current set
                 and the signal set pointed to by the set
                 argument.

   SIG_UNBLOCK   The resulting set is the intersection of the
                 current set and the complement of the signal set
                 pointed to by the set argument.

   SIG_SETMASK   The resulting set is the signal set pointed to by
                 the set argument.


set
Specifies the signal set by pointing to a set of signals used to change the blocked set. If this set value is NULL, the how argument is ignored and the process signal mask is unchanged.
oset
Receives the value of the current signal mask (unless this value is NULL).

Description

This routine examines or changes the calling thread's signal mask. Typically, you use the SIG_BLOCK option for the how value to block signals during a critical section of code, and then use the SIG_SETMASK option of this routine to restore the mask to the previous value returned by the previous call to the pthread_ sigmask function.

If there are any unblocked signals pending after a call to this routine, at least one of those signals will be delivered before this routine returns.

This routine does not allow the SIGKILL or SIGSTOP signals to be blocked. If a program attempts to block one of these signals, pthread_sigmask gives no indication of the error.

Return Values

If an error condition occurs, this routine returns an integer value indicating the type of error. Possible return values are as follows:
Return        Description

0 Successful completion. [EINVAL] The value specified for how is invalid.



[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]