* 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.
This commit is contained in:
Christopher Faylor
2001-09-15 00:47:44 +00:00
parent bf0338856a
commit 9661a0c8b7
7 changed files with 46 additions and 19 deletions

View File

@@ -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
}