* dcrt0.cc (dll_crt0_1): Move exception list and constructor stuff earlier in

the process.  Use new second argument to set_myself.
(cygwin_dll_init): Initialize exception list and constructor stuff here.
(_dll_crt0): And here.  Also, deal with inherited pinfo shared memory region
from parent.
* pinfo.cc (set_myself): Accept a second argument signifying the a shared
memory region, passed from an execing parent.
(pinfo_init): Ditto.
* pinfo.h: Ditto.
* shared.h (child_info): Add a handle field to pass to child.
* spawn.cc (spawn_guts): Create a shared handle to pass to an execed child.
* winsup.h: Remove extraneous declaration.
This commit is contained in:
Christopher Faylor
2000-08-24 04:07:50 +00:00
parent e1cf4ae80c
commit f5589e4118
7 changed files with 81 additions and 24 deletions

View File

@ -494,9 +494,13 @@ skip_arg_parsing:
}
init_child_info (chtype, ciresrv, (mode == _P_OVERLAY) ? myself->pid : 1, spr);
if (mode != _P_OVERLAY ||
!DuplicateHandle (hMainProc, myself.shared_handle (), hMainProc,
&ciresrv->myself_pinfo, 0,
TRUE, DUPLICATE_SAME_ACCESS))
ciresrv->myself_pinfo = NULL;
LPBYTE resrv = si.lpReserved2 + sizeof *ciresrv;
# undef ciresrv
if (fdtab.linearize_fd_array (resrv, len) < 0)
{
@ -611,6 +615,9 @@ skip_arg_parsing:
free (envblock);
MALLOC_CHECK;
if (ciresrv->myself_pinfo)
CloseHandle (ciresrv->myself_pinfo);
/* Set errno now so that debugging messages from it appear before our
final debugging message [this is a general rule for debugging
messages]. */