*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> sigsetmask (2)              
Title
Content
Arch
Section
 

sigprocmask(2)

Contents


NAME    [Toc]    [Back]

       sigprocmask, sigsetmask - Set the current signal mask

SYNOPSIS    [Toc]    [Back]

       #include <signal.h>

       int sigprocmask(
               int how,
               const sigset_t *set,
               sigset_t *o_set );

       The  following  function  declaration  does not conform to
       current standards and is supported only for backward  compatibility:
 int sigsetmask(
               int signal_mask );

STANDARDS    [Toc]    [Back]

       Interfaces  documented  on  this reference page conform to
       industry standards as follows:

       sigprocmask(): XSH4.0, XSH4.2, XSH5.0

       Refer to the standards(5) reference page for more information
 about industry standards and associated tags.

PARAMETERS    [Toc]    [Back]

       Indicates the manner in which the set of masked signals is
       changed; it has one of the following values: The resulting
       set  is  the  union  of the current set and the signal set
       pointed to by the set parameter.  The resulting set is the
       intersection  of the current set and the complement of the
       signal set pointed to by the set parameter.  The resulting
       set  is  the  signal  set pointed to by the set parameter.
       Specifies the signal set. If the value of the set  parameter
  is not null, it points to a set of signals to be used
       to change the currently blocked set.  If the value of  the
       set  parameter  is null, the value of the how parameter is
       not significant and the process signal mask is  unchanged;
       thus,  the  call  can  be  used to inquire about currently
       blocked signals.  If the o_set parameter is not  the  null
       value,  the  signal mask in effect at the time of the call
       is stored in the space pointed to by the o_set  parameter.
       Specifies the new signal mask for the process.

DESCRIPTION    [Toc]    [Back]

       The  sigprocmask()  function  is used to examine or change
       the signal mask of the calling process.

       Typically, you would use the sigprocmask (SIG_BLOCK)  call
       to  block  signals  during a critical section of code, and
       then use the sigprocmask (SIG_SETMASK) call to restore the
       mask  to  the  previous  value returned by the sigprocmask
       (SIG_BLOCK) call.

       If there are any unblocked signals pending after the  call
       to  the sigprocmask() function, at least one of those signals
 will be delivered before the  sigprocmask()  function
       returns.

       The  sigprocmask()  function does not allow the SIGKILL or
       SIGSTOP signals to be blocked. If a  program  attempts  to
       block  one  of  these  signals, the sigprocmask() function
       gives no indication of the error.

       The sigsetmask() function allows the process  signal  mask
       to  change  for  signal values 1 to 31. This same function
       can be accomplished  for  all  values  with  the  sigprocmask(SIG_SETMASK)
  call.   The  signal  of value i will be
       blocked if the i-th bit of the  signal_mask  parameter  is
       set.

RETURN VALUES    [Toc]    [Back]

       Upon  successful  completion,  the  sigprocmask() function
       returns a value of 0 (zero). If the sigprocmask() function
       fails,  the  signal  mask  of  the process is unchanged, a
       value of -1 is returned, and errno is set to indicate  the
       error.

       Upon  successful  completion,  the  sigsetmask()  function
       returns the value of the  previous  signal  mask.  If  the
       function fails, a value of -1 is returned.

ERRORS    [Toc]    [Back]

       The  sigprocmask()  function  sets  errno to the specified
       value for the following conditions: The value of  the  how
       parameter  is  not  equal  to  one  of the defined values.
       [Tru64 UNIX]  The set or o_set parameter points to a location
 outside the allocated address space of the process.

EXAMPLES    [Toc]    [Back]

       The  following  example sets the signal mask to block only
       the SIGINT signal from delivery:

       #include <signal.h> int return_value; sigset_t newset;
        ...   sigemptyset(&newset);  sigaddset(&newset,  SIGINT);
       return_value = sigprocmask (SIG_SETMASK, &newset, NULL);

SEE ALSO    [Toc]    [Back]

      
      
       Functions:     kill(2),    sigaction(2),    sigsuspend(2),
       sigvec(2), sigpause(3)

       Standards: standards(5)



                                                   sigprocmask(2)
[ Back ]
 Similar pages
Name OS Title
sigsetmask NetBSD set current signal mask
sigsetmask HP-UX set current signal mask
sigsetmask OpenBSD set current signal mask
sigblock FreeBSD manipulate current signal mask
sigprocmask FreeBSD manipulate current signal mask
sigprocmask OpenBSD manipulate current signal mask
sigprocmask NetBSD manipulate current signal mask
sigsetmask FreeBSD manipulate current signal mask
sigmask FreeBSD manipulate current signal mask
sigsetmask IRIX set current signal mask (4.3BSD)
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service