runit

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

sig_catch.c (239B)


      1 /* Public domain. */
      2 
      3 #include <signal.h>
      4 #include "sig.h"
      5 
      6 void sig_catch(int sig,void (*f)(int))
      7 {
      8   struct sigaction sa;
      9   sa.sa_handler = f;
     10   sa.sa_flags = 0;
     11   sigemptyset(&sa.sa_mask);
     12   sigaction(sig,&sa,(struct sigaction *) 0);
     13 }