aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.threads/killed.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.threads/killed.c')
-rw-r--r--gdb/testsuite/gdb.threads/killed.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.threads/killed.c b/gdb/testsuite/gdb.threads/killed.c
new file mode 100644
index 0000000..6cb3928
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/killed.c
@@ -0,0 +1,24 @@
+#include <sys/types.h>
+#include <signal.h>
+#include <pthread.h>
+#include <stdio.h>
+
+int pid;
+
+void *
+child_func (void *dummy)
+{
+ kill (pid, SIGKILL);
+ exit (1);
+}
+
+int
+main ()
+{
+ pthread_t child;
+
+ pid = getpid ();
+ pthread_create (&child, 0, child_func, 0);
+ for (;;)
+ sleep (10000);
+}