Commit | Line | Data |
---|---|---|
c906108c SS |
1 | /* Test GDB dealing with stuff like stepping into sigtramp. */ |
2 | ||
3 | #include <signal.h> | |
085dd6e6 | 4 | #include <unistd.h> |
c906108c | 5 | |
c906108c SS |
6 | |
7 | static int count = 0; | |
8 | ||
085dd6e6 JM |
9 | #ifdef PROTOTYPES |
10 | static void | |
11 | handler (int sig) | |
12 | #else | |
c906108c SS |
13 | static void |
14 | handler (sig) | |
15 | int sig; | |
085dd6e6 | 16 | #endif |
c906108c SS |
17 | { |
18 | signal (sig, handler); | |
19 | ++count; | |
20 | } | |
21 | ||
22 | static void | |
23 | func1 () | |
24 | { | |
25 | ++count; | |
26 | } | |
27 | ||
28 | static void | |
29 | func2 () | |
30 | { | |
31 | ++count; | |
32 | } | |
33 | ||
34 | int | |
35 | main () | |
36 | { | |
c906108c SS |
37 | #ifdef SIGALRM |
38 | signal (SIGALRM, handler); | |
39 | #endif | |
40 | #ifdef SIGUSR1 | |
41 | signal (SIGUSR1, handler); | |
42 | #endif | |
43 | alarm (1); | |
44 | ++count; /* first */ | |
45 | alarm (1); | |
46 | ++count; /* second */ | |
47 | func1 (); | |
48 | alarm (1); | |
49 | func2 (); | |
50 | return count; | |
51 | } |