1 /* include signal_intr */ 2 #include "unp.h" 3 4 Sigfunc * signal_intr(int signo,Sigfunc * func)5signal_intr(int signo, Sigfunc *func) 6 { 7 struct sigaction act, oact; 8 9 act.sa_handler = func; 10 sigemptyset(&act.sa_mask); 11 act.sa_flags = 0; 12 #ifdef SA_INTERRUPT /* SunOS */ 13 act.sa_flags |= SA_INTERRUPT; 14 #endif 15 if (sigaction(signo, &act, &oact) < 0) 16 return(SIG_ERR); 17 return(oact.sa_handler); 18 } 19 /* end signal_intr */ 20 21 Sigfunc * Signal_intr(int signo,Sigfunc * func)22Signal_intr(int signo, Sigfunc *func) 23 { 24 Sigfunc *sigfunc; 25 26 if ( (sigfunc = signal_intr(signo, func)) == SIG_ERR) 27 err_sys("signal_intr error"); 28 return(sigfunc); 29 } 30