Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / gdb6 / gdb / testsuite / gdb.base / interrupt.c
bloba895d4b7d814adaa868b5f3211fdee1375302602
1 #include <errno.h>
2 #include <stdio.h>
3 #include <unistd.h>
4 #include <stdlib.h>
5 int
6 main ()
8 char x;
9 int nbytes;
10 #ifdef usestubs
11 set_debug_traps();
12 breakpoint();
13 #endif
14 printf ("talk to me baby\n");
15 while (1)
17 nbytes = read (0, &x, 1);
18 if (nbytes < 0)
20 #ifdef EINTR
21 if (errno != EINTR)
22 #endif
23 perror ("");
25 else if (nbytes == 0)
27 printf ("end of file\n");
28 exit (0);
30 else
31 write (1, &x, 1);
33 return 0;
36 int
37 func1 ()
39 return 4;