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