aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.hp/foll-vfork.c')
-rw-r--r--gdb/testsuite/gdb.hp/foll-vfork.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.hp/foll-vfork.c b/gdb/testsuite/gdb.hp/foll-vfork.c
new file mode 100644
index 00000000000..c7e6cd32909
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/foll-vfork.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+
+main ()
+{
+ int pid;
+
+ pid = vfork ();
+ if (pid == 0) {
+ printf ("I'm the child!\n");
+ execlp ("gdb.hp/vforked-program", "gdb.hp/vforked-program", (char *)0);
+ }
+ else {
+ printf ("I'm the proud parent of child #%d!\n", pid);
+ }
+}