aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/catch-syscall.c
diff options
context:
space:
mode:
authorSergio Durigan Junior <sergiodj@redhat.com>2009-09-15 03:32:06 +0000
committerSergio Durigan Junior <sergiodj@redhat.com>2009-09-15 03:32:06 +0000
commitfbbe92c5af983c19392204f1335f1251fc11519a (patch)
treea0eadbb6c4e15b015e14be0006d7d7e8ee56f776 /gdb/testsuite/gdb.base/catch-syscall.c
parenta96d9b2e9a79e6cc7a9da9b4e5bab6fcc35f1eb4 (diff)
downloadgdb-fbbe92c5af983c19392204f1335f1251fc11519a.zip
gdb-fbbe92c5af983c19392204f1335f1251fc11519a.tar.gz
gdb-fbbe92c5af983c19392204f1335f1251fc11519a.tar.bz2
Forgot to add these files. They are referent to the last commit,
"Implementing the catch syscall feature".
Diffstat (limited to 'gdb/testsuite/gdb.base/catch-syscall.c')
-rw-r--r--gdb/testsuite/gdb.base/catch-syscall.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/catch-syscall.c b/gdb/testsuite/gdb.base/catch-syscall.c
new file mode 100644
index 0000000..64850de
--- /dev/null
+++ b/gdb/testsuite/gdb.base/catch-syscall.c
@@ -0,0 +1,25 @@
+/* This file is used to test the 'catch syscall' feature on GDB.
+
+ Please, if you are going to edit this file DO NOT change the syscalls
+ being called (nor the order of them). If you really must do this, then
+ take a look at catch-syscall.exp and modify there too.
+
+ Written by Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com>
+ September, 2008 */
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+int
+main (void)
+{
+ /* A close() with a wrong argument. We are only
+ interested in the syscall. */
+ close (-1);
+
+ chroot (".");
+
+ /* The last syscall. Do not change this. */
+ _exit (0);
+}