diff options
author | Christopher Faylor <me@cgf.cx> | 2001-07-17 03:41:52 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-07-17 03:41:52 +0000 |
commit | 5457dfcb8174f0ff25a0522050c1d79e710a68df (patch) | |
tree | 65df1229b3c4d86e54d861f70fc1f2458edc4736 /winsup/cygwin/dcrt0.cc | |
parent | 30640285c33dedac2099ebd0492b86b3bbabaaad (diff) | |
download | cygnal-5457dfcb8174f0ff25a0522050c1d79e710a68df.tar.gz cygnal-5457dfcb8174f0ff25a0522050c1d79e710a68df.tar.bz2 cygnal-5457dfcb8174f0ff25a0522050c1d79e710a68df.zip |
* child_info.h: Bump magic number.
(class child_info): Add an element.
* cygheap.cc (init_cheap): Allocate cygwin heap in shared memory area.
(cygheap_fixup_in_child): Map cygwin heap, passed from parent via shared memory
into correct address.
(cygheap_setup_for_child): New function.
* cygheap.h: Declare new functions.
* dcrt0.cc (dll_crt0_1): Accomodate new cygheap_fixup_in_child arguments.
Avoid protecting subproc_ready unless it is spawn/nowait.
* fork.cc (fork_parent): Use new cygheap_setup_for_child function to setup
cygwin heap info. Close passed cygheap shared memory handle.
* spawn.cc (spawn_guts): Ditto. Also, reorganize to avoid synchronization
between parent and child in non-P_OVERLAY case.
* sigproc.cc (wait_sig): Only signal subproc_ready when execing.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index cc4986949..8fdae5d8e 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -669,13 +669,11 @@ dll_crt0_1 () if (child_proc_info) { - cygheap = child_proc_info->cygheap; - cygheap_max = child_proc_info->cygheap_max; switch (child_proc_info->type) { case PROC_FORK: case PROC_FORK1: - cygheap_fixup_in_child (child_proc_info->parent, 0); + cygheap_fixup_in_child (child_proc_info, 0); alloc_stack (fork_info); set_myself (mypid); user_data->heaptop = child_proc_info->heaptop; @@ -690,7 +688,7 @@ dll_crt0_1 () hexec_proc = spawn_info->hexec_proc; around: HANDLE h; - cygheap_fixup_in_child (spawn_info->parent, 1); + cygheap_fixup_in_child (spawn_info, 1); if (!spawn_info->moreinfo->myself_pinfo || !DuplicateHandle (hMainProc, spawn_info->moreinfo->myself_pinfo, hMainProc, &h, 0, 0, @@ -709,7 +707,8 @@ dll_crt0_1 () old_title = strcpy (title_buf, spawn_info->moreinfo->old_title); cfree (spawn_info->moreinfo->old_title); } - ProtectHandle (child_proc_info->subproc_ready); + if (child_proc_info->subproc_ready) + ProtectHandle (child_proc_info->subproc_ready); myself->uid = spawn_info->moreinfo->uid; if (myself->uid == USHRT_MAX) cygheap->user.set_sid (NULL); |