This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Add comments noting that vfork() might actually be fork()
- To: gdb-patches at sources dot redhat dot com
- Subject: [PATCH] Add comments noting that vfork() might actually be fork()
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Sun, 8 Apr 2001 11:31:09 -0700
I've just committed the following...
* fork-child.c (fork_inferior, clone_and_follow_inferior):
Document fact that apparent call to vfork() might actually be
a call to fork() instead.
* ser-pipe.c (pipe_open): Likewise.
Index: fork-child.c
===================================================================
RCS file: /cvs/src/src/gdb/fork-child.c,v
retrieving revision 1.11
diff -u -p -r1.11 fork-child.c
--- fork-child.c 2001/03/26 16:44:32 1.11
+++ fork-child.c 2001/04/08 18:18:06
@@ -253,6 +253,9 @@ fork_inferior (char *exec_file_arg, char
if (pre_trace_fun != NULL)
(*pre_trace_fun) ();
+ /* Create the child process. Note that the apparent call to vfork()
+ below *might* actually be a call to fork() due to the fact that
+ autoconf will ``#define vfork fork'' on certain platforms. */
if (debug_fork)
pid = fork ();
else
@@ -420,7 +423,9 @@ clone_and_follow_inferior (int child_pid
if (status < 0)
error ("error getting pipe for handoff semaphore");
- /* Clone the debugger. */
+ /* Clone the debugger. Note that the apparent call to vfork()
+ below *might* actually be a call to fork() due to the fact that
+ autoconf will ``#define vfork fork'' on certain platforms. */
if (debug_fork)
debugger_pid = fork ();
else
Index: ser-pipe.c
===================================================================
RCS file: /cvs/src/src/gdb/ser-pipe.c,v
retrieving revision 1.9
diff -u -p -r1.9 ser-pipe.c
--- ser-pipe.c 2001/03/06 08:21:16 1.9
+++ ser-pipe.c 2001/04/08 18:18:09
@@ -65,6 +65,10 @@ pipe_open (serial_t scb, const char *nam
if (socketpair (AF_UNIX, SOCK_STREAM, 0, pdes) < 0)
return -1;
+ /* Create the child process to run the command in. Note that the
+ apparent call to vfork() below *might* actually be a call to
+ fork() due to the fact that autoconf will ``#define vfork fork''
+ on certain platforms. */
pid = vfork ();
/* Error. */