aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/interrupt.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>1994-06-07 01:57:15 +0000
committerStan Shebs <shebs@codesourcery.com>1994-06-07 01:57:15 +0000
commitef44eed173353ff002da6fe92680e40068cd081f (patch)
treebeeeaecb50227b8c1fe964debaf3c8f45bc9ac9a /gdb/testsuite/gdb.base/interrupt.c
parent33268150cbbcc90ec13f5603d566537cf4cd569e (diff)
downloadgdb-ef44eed173353ff002da6fe92680e40068cd081f.zip
gdb-ef44eed173353ff002da6fe92680e40068cd081f.tar.gz
gdb-ef44eed173353ff002da6fe92680e40068cd081f.tar.bz2
Reorganized GDB tests - base
Diffstat (limited to 'gdb/testsuite/gdb.base/interrupt.c')
-rw-r--r--gdb/testsuite/gdb.base/interrupt.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/interrupt.c b/gdb/testsuite/gdb.base/interrupt.c
new file mode 100644
index 0000000..bafbaa5
--- /dev/null
+++ b/gdb/testsuite/gdb.base/interrupt.c
@@ -0,0 +1,31 @@
+#include <errno.h>
+#include <stdio.h>
+int
+main ()
+{
+ char x;
+ int nbytes;
+ printf ("talk to me baby\n");
+ while (1)
+ {
+ nbytes = read (0, &x, 1);
+ if (nbytes < 0)
+ {
+ if (errno != EINTR)
+ perror ("");
+ }
+ else if (nbytes == 0)
+ {
+ printf ("end of file\n");
+ exit (0);
+ }
+ else
+ write (1, &x, 1);
+ }
+}
+
+int
+func1 ()
+{
+ return 4;
+}