patch-2.2.0-pre7 linux/arch/i386/kernel/process.c
Next file: linux/arch/i386/kernel/ptrace.c
Previous file: linux/arch/i386/kernel/ioport.c
Back to the patch index
Back to the overall index
- Lines: 24
- Date:
Sat Jan 9 00:07:41 1999
- Orig file:
v2.2.0-pre6/linux/arch/i386/kernel/process.c
- Orig date:
Fri Jan 8 22:36:00 1999
diff -u --recursive --new-file v2.2.0-pre6/linux/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c
@@ -778,17 +778,19 @@
newsp = regs.ecx;
if (!newsp)
newsp = regs.esp;
- return do_fork(clone_flags, newsp, ®s);
+ return do_fork(clone_flags & ~CLONE_VFORK, newsp, ®s);
}
asmlinkage int sys_vfork(struct pt_regs regs)
{
- int child;
+ int child;
+ struct semaphore sem = MUTEX_LOCKED;
- child = do_fork(CLONE_VM | SIGCHLD, regs.esp, ®s);
+ current->vfork_sem = &sem;
+ child = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs.esp, ®s);
if (child > 0)
- sleep_on(¤t->vfork_sleep);
+ down(&sem);
return child;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov