...
Code Block | ||
---|---|---|
| ||
/* Equivalent to signal(SIGUSR1, handler) but makemakes * signal persistent */ struct sigaction act; act.sa_handler = handler; act.sa_flags = 0; if (sigemptyset(&act.sa_mask) != 0) { /* handle error */ } if (sigaction(SIGUSR1, &act, NULL) != 0) { /* handle error */ } |
...
Code Block | ||
---|---|---|
| ||
/* Equivalent to signal(SIGUSR1, handler) but makemakes * signal non-persistent */ struct sigaction act; act.sa_handler = handler; act.sa_flags = SA_RESETHAND; if (sigemptyset(&act.sa_mask) != 0) { /* handle error */ } if (sigaction(SIGUSR1, &act, NULL) != 0) { /* handle error */ } |
...