Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-09-15 04:47:44 +0400
committerChristopher Faylor <me@cgf.cx>2001-09-15 04:47:44 +0400
commit9661a0c8b7f59960d6d180ffa2872710f5253913 (patch)
tree08fad6a660efa6a0b678f417fcb826d02917aa76 /winsup/cygwin/fork.cc
parentbf0338856a38f856195d3d517fa5067357ed2f9d (diff)
* dcrt0.cc (dll_crt0_1): Create vfork main storage here so that it can be
queried in waitsig later. * sigproc.cc (wait_sig): Don't deliver a signal if in a vfork. * fork.cc (vfork): Deliver all signals on parent return from vfork.
Diffstat (limited to 'winsup/cygwin/fork.cc')
-rw-r--r--winsup/cygwin/fork.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index 30fca7b2d..c4d122f4d 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -700,6 +700,7 @@ vfork ()
#ifndef NEWVFORK
return fork ();
#else
+ sigframe thisframe;
vfork_save *vf = get_vfork_val ();
char **esp, **pp;
@@ -714,22 +715,22 @@ vfork ()
__asm__ volatile ("movl %%esp,%0": "=r" (vf->vfork_esp):);
__asm__ volatile ("movl %%ebp,%0": "=r" (vf->vfork_ebp):);
for (pp = (char **)vf->frame, esp = vf->vfork_esp;
- esp <= vf->vfork_ebp + 1; pp++, esp++)
+ esp <= vf->vfork_ebp + 2; pp++, esp++)
*pp = *esp;
int res = cygheap->fdtab.vfork_child_dup () ? 0 : -1;
debug_printf ("%d = vfork()", res);
return res;
}
- cygheap->fdtab.vfork_parent_restore ();
-
vf = get_vfork_val ();
- __asm__ volatile ("movl %%esp,%0": "=r" (esp):);
for (pp = (char **)vf->frame, esp = vf->vfork_esp;
- esp <= vf->vfork_ebp + 1; pp++, esp++)
+ esp <= vf->vfork_ebp + 2; pp++, esp++)
*esp = *pp;
+ thisframe.init (mainthread);
+ cygheap->fdtab.vfork_parent_restore ();
+
if (vf->pid < 0)
{
int exitval = -vf->pid;
@@ -740,6 +741,7 @@ vfork ()
int pid = vf->pid;
vf->pid = 0;
+ sig_dispatch_pending ();
return pid;
#endif
}