summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/multi-forks.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/multi-forks.c')
-rw-r--r--gdb/testsuite/gdb.base/multi-forks.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/multi-forks.c b/gdb/testsuite/gdb.base/multi-forks.c
new file mode 100644
index 00000000000..206106768a7
--- /dev/null
+++ b/gdb/testsuite/gdb.base/multi-forks.c
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+pid_t pids[4];
+
+main()
+{
+ int i;
+
+ for (i = 0; i < 4; i++)
+ pids [i] = fork ();
+
+ printf ("%d ready\n", getpid ());
+ sleep (2);
+ printf ("%d done\n", getpid ());
+ exit (0); /* Set exit breakpoint here. */
+}