summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fork.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-12-05 10:59:21 +0000
committerCorinna Vinschen <corinna@vinschen.de>2006-12-05 10:59:21 +0000
commitc6674b53d3b910b8d3dd4095d626e554b5c32fa1 (patch)
treef5230c3705aecf055c5210f469208ae72c9c36a2 /winsup/cygwin/fork.cc
parent489bb390ceff00454f0f904c8c96cd39405918c6 (diff)
downloadcygnal-c6674b53d3b910b8d3dd4095d626e554b5c32fa1.tar.gz
cygnal-c6674b53d3b910b8d3dd4095d626e554b5c32fa1.tar.bz2
cygnal-c6674b53d3b910b8d3dd4095d626e554b5c32fa1.zip
* dcrt0.cc (get_cygwin_startup_info): Change zeros to DWORD array.
Expect first DWORD in child_info struct being set to non-zero if wincap.needs_count_in_si_lpres2 is set. Add comment to explain why. * fork.cc (frok::parent): Set ch.zero[0] to a sensible count value if wincap.needs_count_in_si_lpres2 is set. * spawn.cc (spawn_guts): Ditto. Add filler bytes after ch on stack to accomodate needs_count_in_si_lpres2. * wincap.h: Define needs_count_in_si_lpres2 throughout. * wincap.cc: Ditto.
Diffstat (limited to 'winsup/cygwin/fork.cc')
-rw-r--r--winsup/cygwin/fork.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index ed85e74cf..cc5beceb7 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -280,9 +280,14 @@ frok::parent (void *stack_here)
memset (&si, 0, sizeof (si));
si.cb = sizeof (STARTUPINFO);
+
si.lpReserved2 = (LPBYTE) &ch;
si.cbReserved2 = sizeof (ch);
+ /* See comment in dcrt0.cc, function get_cygwin_startup_info. */
+ if (wincap.needs_count_in_si_lpres2 ())
+ ch.zero[0] = sizeof (ch) / 5;
+
syscall_printf ("CreateProcess (%s, %s, 0, 0, 1, %p, 0, 0, %p, %p)",
myself->progname, myself->progname, c_flags, &si, &pi);
bool locked = __malloc_lock ();