1 | #include <signal.h> |
---|---|
2 | #include <stdio.h> |
3 | #include <unistd.h> |
4 | |
5 | void handler_usr1 (int i) |
6 | { |
7 | puts (s: "got signal usr1"); |
8 | } |
9 | |
10 | void handler_alrm (int i) |
11 | { |
12 | puts (s: "got signal ALRM"); |
13 | } |
14 | |
15 | int main () |
16 | { |
17 | int i = 0; |
18 | |
19 | signal (SIGUSR1, handler: handler_usr1); |
20 | signal (SIGALRM, handler: handler_alrm); |
21 | |
22 | puts (s: "Put breakpoint here"); |
23 | |
24 | while (i++ < 20) |
25 | sleep (seconds: 1); |
26 | } |
27 | |
28 |