sigprocmask

Examines and changes the signal mask of the calling thread.

Library:LibC
Classification:ANSI
Service:Signal Services

Syntax

  #include <signal.h> 
   
  int sigprocmask (
     int               how,
     const sigset_t   *act,
     sigset_t         *oldact );
  

Parameters

how

(IN) Specifies how the signal set is to be changed:

Constant

Value

Description

SIG_BLOCK

0x00000000

Creates a union of the new and old set of signals.

SIB_UNBLOCK

0x00000001

Creates an intersection of the current set and the complement of the new set.

SIG_SETMASK

0xFFFFFFFF

Replaces the old set of signals with the new set.

act

(IN) Points to the new signal set. If set to a null pointer, the signal set is not changed and the value of the how parameter is ignored.

oldact

(OUT) Points to the old signal set, if the oldact parameter is not a null pointer.

Return Values

If successful, returns 0. Otherwise, returns -1, sets errno to indicate the error condition, and does not change the calling thread's signal mask.

Decimal

Constant

Description

9

EINVAL

The how parameter has an invalid value.

79

ENOTSUP

The operation is not supported because the NLM is not linked with POSIX semantics.

105

ENOCONTEXT

No thread context is present.

Remarks

IMPORTANT:This function is only available to NLMs that are using POSIX semantics.

If the act parameter is a null pointer, the sigprocmask can be used to examine the current signal set. The how parameter is ignored, and the oldact parameter returns the current signal set.

If there are any pending unblocked signals after the call to sigprocmask, at least one of these signals must be delivered before the sigprocmask function returns.

See Also