ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumwith_gc
Last change
on this file since 6c7099a was
4149d9d,
checked in by Thierry Delisle <tdelisle@…>, 7 years ago
|
replacing old repeat script with c program
|
-
Property mode set to
100644
|
File size:
658 bytes
|
Line | |
---|
1 | #include <stdio.h> |
---|
2 | #include <stdlib.h> |
---|
3 | #include <signal.h> |
---|
4 | |
---|
5 | void sig_handler(int signo) |
---|
6 | { |
---|
7 | fprintf(stderr, "received %d\n", signo); |
---|
8 | exit(0); |
---|
9 | } |
---|
10 | |
---|
11 | void sig(int signo) { |
---|
12 | if (signal(signo, sig_handler) == SIG_ERR) |
---|
13 | { |
---|
14 | fprintf(stderr,"Error\n"); |
---|
15 | exit(1); |
---|
16 | } |
---|
17 | } |
---|
18 | |
---|
19 | int main(void) |
---|
20 | { |
---|
21 | printf("Starting...\n"); |
---|
22 | sig(SIGHUP); |
---|
23 | sig(SIGINT); |
---|
24 | sig(SIGQUIT); |
---|
25 | sig(SIGILL); |
---|
26 | sig(SIGABRT); |
---|
27 | sig(SIGFPE); |
---|
28 | sig(SIGSEGV); |
---|
29 | sig(SIGPIPE); |
---|
30 | sig(SIGALRM); |
---|
31 | sig(SIGTERM); |
---|
32 | sig(SIGUSR1); |
---|
33 | sig(SIGUSR2); |
---|
34 | sig(SIGCHLD); |
---|
35 | sig(SIGCONT); |
---|
36 | sig(SIGTSTP); |
---|
37 | sig(SIGTTIN); |
---|
38 | sig(SIGTTOU); |
---|
39 | while(1); |
---|
40 | return 0; |
---|
41 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.