| author | "Tomas Zeman <tomas.zeman@sun.com>" |
| Fri, 19 Oct 2007 14:06:22 +0200 | |
| changeset 0 | 068428edee47 |
| permissions | -rw-r--r-- |
| 0 | 1 |
#include <signal.h> |
2 |
#include "sig.h" |
|
3 |
#include "hassgact.h" |
|
4 |
||
5 |
void sig_catch(sig,f) |
|
6 |
int sig; |
|
7 |
void (*f)(); |
|
8 |
{
|
|
9 |
#ifdef HASSIGACTION |
|
10 |
struct sigaction sa; |
|
11 |
sa.sa_handler = f; |
|
12 |
sa.sa_flags = 0; |
|
13 |
sigemptyset(&sa.sa_mask); |
|
14 |
sigaction(sig,&sa,(struct sigaction *) 0); |
|
15 |
#else |
|
16 |
signal(sig,f); /* won't work under System V, even nowadays---dorks */ |
|
17 |
#endif |
|
18 |
} |