...
Code Block | ||
---|---|---|
| ||
void handler(int signum) { /* handling code */ } /* ... */ /* Equivalent to signal( signum, handler); but make signal persistent */ struct sigaction act; act.sa_handler = &handler; act.sa_flags = 0; if (sigfillsetsigemptyset( &act.sa_mask) != 0) { /* handle error */ } if (sigaction(signum, &act, NULL) != 0) { /* handle error */ } |
...