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

  man pages->OpenBSD man pages -> sigmask (3)              
Title
Content
Arch
Section
 

SIGBLOCK(3)

Contents


NAME    [Toc]    [Back]

     sigblock - block signals

SYNOPSIS    [Toc]    [Back]

     #include <signal.h>

     int
     sigblock(int mask);

     int
     sigmask(int signum);

DESCRIPTION    [Toc]    [Back]

     This interface is made obsolete by:  sigprocmask(2).

     sigblock() adds the signals specified in mask to the set  of
signals currently
  being blocked from delivery.  Signals are blocked if
the corresponding
 bit in mask is a 1; the macro sigmask() is provided
to construct
     the mask for a given signum.

     It  is  not  possible  to block SIGKILL or SIGSTOP; this restriction is
     silently imposed by the system.

RETURN VALUES    [Toc]    [Back]

     The previous set of masked signals is returned.

EXAMPLES    [Toc]    [Back]

     The following example utilizing sigblock():

           int omask;

           omask = sigblock(sigmask(SIGINT) | sigmask(SIGHUP));

     Becomes:

           sigset_t set, oset;

           sigemptyset(&set);
           sigaddset(&set, SIGINT);
           sigaddset(&set, SIGHUP);
           sigprocmask(SIG_BLOCK, &set, &oset);

     Another use of sigblock() is  to  get  the  current  set  of
masked signals
     without changing what is actually blocked.  Instead of:

           int set;

           set = sigblock(0);

     Use the following:

           sigset_t set;

           sigprocmask(SIG_BLOCK, NULL, &set);

SEE ALSO    [Toc]    [Back]

      
      
     kill(2), sigaction(2), sigprocmask(2), sigsetmask(3), sigsetops(3)

HISTORY    [Toc]    [Back]

     The sigblock() function call appeared in 4.2BSD and has been
deprecated.

OpenBSD      3.6                          March      10,     1991
[ Back ]
 Similar pages
Name OS Title
sigblock IRIX block signals from delivery to process (4.3BSD)
rmvb Tru64 STREAMS: Removes a message block from a message block
ssignal IRIX software signals
sigpending FreeBSD get pending signals
sigpending NetBSD get pending signals
signal IRIX base signals
sigwait FreeBSD select a set of signals
sigpending OpenBSD get pending signals
signal HP-UX description of signals
signal Linux list of available signals
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service