runit

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

sig_block.c (437B)


      1 /* Public domain. */
      2 
      3 #include <signal.h>
      4 #include "sig.h"
      5 
      6 void sig_block(int sig)
      7 {
      8   sigset_t ss;
      9   sigemptyset(&ss);
     10   sigaddset(&ss,sig);
     11   sigprocmask(SIG_BLOCK,&ss,(sigset_t *) 0);
     12 }
     13 
     14 void sig_unblock(int sig)
     15 {
     16   sigset_t ss;
     17   sigemptyset(&ss);
     18   sigaddset(&ss,sig);
     19   sigprocmask(SIG_UNBLOCK,&ss,(sigset_t *) 0);
     20 }
     21 
     22 void sig_blocknone(void)
     23 {
     24   sigset_t ss;
     25   sigemptyset(&ss);
     26   sigprocmask(SIG_SETMASK,&ss,(sigset_t *) 0);
     27 }