Debian Codegraph @

test cases/unit/110 freeze/freeze.c

raw
1 #include<stdio.h>
2 #include <signal.h>
3 #include <string.h>
4 #include <stdlib.h>
5
6 static void do_nothing(int signo, siginfo_t *info, void *context) {
7 }
8
9 int main(int argc, char **argv) {
10 struct sigaction sa;
11 memset(&sa, 0, sizeof(struct sigaction));
12 sa.sa_sigaction = do_nothing;
13 if (sigaction(SIGTERM, &sa, NULL) == -1) {
14 printf("Could not set up signal handler.\n");
15 return 1;
16 }
17 printf("Freezing forever.\n");
18 while(1) {
19 }
20 return 0;
21 }