import gdb-1999-06-28 snapshot
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / interrupt.c
CommitLineData
c906108c
SS
1#include <errno.h>
2#include <stdio.h>
085dd6e6
JM
3#include <unistd.h>
4#include <stdlib.h>
c906108c
SS
5int
6main ()
7{
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)
16 {
17 nbytes = read (0, &x, 1);
18 if (nbytes < 0)
19 {
20#ifdef EINTR
21 if (errno != EINTR)
22#endif
23 perror ("");
24 }
25 else if (nbytes == 0)
26 {
27 printf ("end of file\n");
28 exit (0);
29 }
30 else
31 write (1, &x, 1);
32 }
085dd6e6 33 return 0;
c906108c
SS
34}
35
36int
37func1 ()
38{
39 return 4;
40}
This page took 0.041745 seconds and 4 git commands to generate.