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

@@ -59,8 +59,6 @@ public:
/* Used to spawn a child for fork(), among other things. */
char progname[MAX_PATH];
HANDLE parent_alive;
/* User information.
The information is derived from the GetUserName system call,
with the name looked up in /etc/passwd and assigned a default value
@@ -83,8 +81,6 @@ public:
long start_time;
struct rusage rusage_self;
struct rusage rusage_children;
/* Pointer to mmap'ed areas for this process. Set up by fork. */
void *mmap_ptr;
/* Non-zero if process was stopped by a signal. */
char stopsig;
@@ -209,8 +205,7 @@ extern void __stdcall pinfo_fixup_after_fork ();
extern HANDLE hexec_proc;
/* For mmaps across fork(). */
int __stdcall recreate_mmaps_after_fork (void *);
void __stdcall set_child_mmap_ptr (_pinfo *);
int __stdcall fixup_mmaps_after_fork ();
void __stdcall fill_rusage (struct rusage *, HANDLE);
void __stdcall add_rusage (struct rusage *, struct rusage *);