nightmaremail

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

sig_catch.c (351B)


      1 #include <signal.h>
      2 #include <stddef.h>
      3 #include "sig.h"
      4 #include "hassgact.h"
      5 
      6 void sig_catch(sig,f)
      7 int sig;
      8 void (*f)();
      9 {
     10 #ifdef HASSIGACTION
     11   struct sigaction sa;
     12   sa.sa_handler = f;
     13   sa.sa_flags = 0;
     14   sigemptyset(&sa.sa_mask);
     15   sigaction(sig,&sa,NULL);
     16 #else
     17   signal(sig,f); /* won't work under System V, even nowadays---dorks */
     18 #endif
     19 }