* config/tc-arm.c (arm_cpus): Add entry for ARM Cortex-M0.
[binutils-gdb.git] / gdb / testsuite / gdb.base / interrupt.c
blob80b906099e666f00909171e7ab54c9799293c833
1 #include <errno.h>
2 #include <stdio.h>
3 #include <unistd.h>
4 #include <stdlib.h>
6 #ifdef SIGNALS
7 #include <signal.h>
9 static void
10 sigint_handler (int signo)
13 #endif
15 int
16 main ()
18 char x;
19 int nbytes;
20 #ifdef usestubs
21 set_debug_traps();
22 breakpoint();
23 #endif
24 #ifdef SIGNALS
25 signal (SIGINT, sigint_handler);
26 #endif
27 printf ("talk to me baby\n");
28 while (1)
30 nbytes = read (0, &x, 1);
31 if (nbytes < 0)
33 #ifdef EINTR
34 if (errno != EINTR)
35 #endif
37 perror ("");
38 return 1;
41 else if (nbytes == 0)
43 printf ("end of file\n");
44 exit (0);
46 else
47 write (1, &x, 1);
49 return 0;
52 int
53 func1 ()
55 return 4;