Commit | Line | Data |
---|---|---|
a4cb37cb SS |
1 | #include <stdio.h> |
2 | #include <signal.h> | |
3 | ||
4 | #ifdef __sh__ | |
5 | #define signal(a,b) /* Signals not supported on this target - make them go away */ | |
6 | #endif | |
7 | ||
8 | ||
085dd6e6 JM |
9 | #ifdef PROTOTYPES |
10 | void | |
11 | handle_USR1 (int sig) | |
12 | { | |
13 | } | |
14 | #else | |
a4cb37cb SS |
15 | void |
16 | handle_USR1 (sig) | |
17 | int sig; | |
18 | { | |
19 | } | |
085dd6e6 | 20 | #endif |
a4cb37cb SS |
21 | |
22 | int value; | |
23 | ||
085dd6e6 JM |
24 | #ifdef PROTOTYPES |
25 | int | |
26 | main (void) | |
27 | #else | |
a4cb37cb SS |
28 | int |
29 | main () | |
085dd6e6 | 30 | #endif |
a4cb37cb SS |
31 | { |
32 | int my_array[3] = { 1, 2, 3 }; | |
33 | ||
34 | value = 7; | |
35 | ||
36 | #ifdef SIGUSR1 | |
37 | signal (SIGUSR1, handle_USR1); | |
38 | #endif | |
39 | ||
40 | printf ("value is %d\n", value); | |
41 | printf ("my_array[2] is %d\n", my_array[2]); | |
5c44784c JM |
42 | |
43 | { | |
44 | int i; | |
45 | for (i = 0; i < 5; i++) | |
46 | value++; | |
47 | } | |
a4cb37cb SS |
48 | |
49 | return 0; | |
50 | } | |
51 |