71ce889da9
* gdb.base/foll-vfork-exit.c: New file. * gdb.base/foll-vfork.exp (top level): New file-describing comment. (vfork_child_follow_to_exit): New procedure. (tcatch_vfork_then_child_follow): Rename as ... (tcatch_vfork_then_child_follow_exec): ... this. (tcatch_vfork_then_child_follow_exit): New procedure. (do_vfork_and_follow_parent_tests): New procedure, factored out from do_vfork_and_exec_tests. (do_vfork_and_follow_child_tests_exec): Ditto. (do_vfork_and_exec_tests): Delete. (do_vfork_and_follow_child_tests_exit): New procedure. (top level): Run tests with both the program that has the vfork child execing, and the program has the vfork child exiting.
38 lines
1 KiB
C
38 lines
1 KiB
C
/* This testcase is part of GDB, the GNU debugger.
|
|
|
|
Copyright 1997, 1999, 2007-2012 Free Software Foundation, Inc.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
|
|
int
|
|
main ()
|
|
{
|
|
int pid;
|
|
|
|
pid = vfork ();
|
|
if (pid == 0)
|
|
{
|
|
printf ("I'm the child!\n");
|
|
_exit (0);
|
|
}
|
|
else
|
|
{
|
|
printf ("I'm the proud parent of child #%d!\n", pid);
|
|
}
|
|
|
|
return 0;
|
|
}
|