Throughout use myself->ppid_handle rather than parent_alive.

* child_info.h (child_info): Eliminate parent_alive.
* dcrt0.cc (dll_crt0_1): Call fork_init for debugging pid creation.
* fork.cc (fork_child): Reflect change to fixup_mmaps_after_fork arguments.
(slow_pid_reuse): New function to grab last 'n' pids to prevent pid reuse.
(fork_parent): Move last_fork_proc into slow_pid_reuse.  Handle fork_pids
debugging.  Eliminate unnecessary call to set_child_mmap_ptr.
(fork_init): New debugging function.
* mmap.cc (fixup_mmaps_after_fork): Renamed from recreate_mmaps_after_fork.
Rely on copied data after a fork.
(set_child_mmap_ptr): Eliminate.
* pinfo.h (_pinfo): Eliminate parent_alive, mmap_ptr and reflect above changes.
* spawn.cc (spawn_guts): Eliminate vestiges of "old way" of sending new hProc
to parent process.
This commit is contained in:
Christopher Faylor
2000-11-15 06:27:48 +00:00
parent fb0a875733
commit 84aeff4126
13 changed files with 144 additions and 119 deletions

View File

@@ -56,7 +56,6 @@ BOOL display_title = FALSE;
BOOL strip_title_path = FALSE;
BOOL allow_glob = TRUE;
HANDLE NO_COPY parent_alive = NULL;
int cygwin_finished_initializing = 0;
/* Used in SIGTOMASK for generating a bit for insertion into a sigset_t.
@@ -739,7 +738,6 @@ dll_crt0_1 ()
cygcwd.init ();
cygbench ("pre-forkee");
if (user_data->forkee)
{
/* If we've played with the stack, stacksize != 0. That means that
@@ -758,6 +756,13 @@ dll_crt0_1 ()
longjmp (fork_info->jmp, fork_info->cygpid);
}
#ifdef DEBUGGING
{
extern void fork_init ();
fork_init ();
}
#endif
/* Initialize our process table entry. */
pinfo_init (envp, envc);
@@ -910,16 +915,6 @@ _dll_crt0 ()
mypid = child_proc_info->cygpid;
cygwin_shared_h = child_proc_info->shared_h;
console_shared_h = child_proc_info->console_h;
/* We don't want subprocesses to inherit this */
if (dynamically_loaded)
parent_alive = NULL;
else if (!DuplicateHandle (hMainProc, child_proc_info->parent_alive,
hMainProc, &parent_alive, 0, 0,
DUPLICATE_SAME_ACCESS
| DUPLICATE_CLOSE_SOURCE))
system_printf ("parent_alive DuplicateHandle failed, %E");
break;
}
default: