[PATCH 7/57][Arm][GAS] Add support for MVE instructions: vstr/vldr
[binutils-gdb.git] / gdb / testsuite / gdb.base / interrupt.c
blob6426015afa8504081f2fb8a8fb436e08cc201582
1 #include <errno.h>
2 #include <stdio.h>
3 #include <unistd.h>
4 #include <stdlib.h>
6 #include "../lib/unbuffer_output.c"
8 #ifdef SIGNALS
9 #include <signal.h>
11 static void
12 sigint_handler (int signo)
15 #endif
17 int
18 main ()
20 char x;
21 int nbytes;
23 gdb_unbuffer_output ();
25 #ifdef SIGNALS
26 signal (SIGINT, sigint_handler);
27 #endif
28 printf ("talk to me baby\n");
29 while (1)
31 nbytes = read (0, &x, 1);
32 if (nbytes < 0)
34 #ifdef EINTR
35 if (errno != EINTR)
36 #endif
38 perror ("");
39 return 1;
42 else if (nbytes == 0)
44 printf ("end of file\n");
45 exit (0);
47 else
48 write (1, &x, 1);
50 return 0;
53 int
54 func1 ()
56 return 4;