From a9266094f229bf84c1ae8256db9430654c62c7cf Mon Sep 17 00:00:00 2001 From: netchild Date: Sun, 15 Oct 2006 13:39:40 +0000 Subject: MFP4 (106538 + 106541): Implement CLONE_VFORK. This fixes the clone05 LTP test. Submitted by: rdivacky --- sys/i386/linux/linux_machdep.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sys/i386/linux/linux_machdep.c') diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c index 849170b..cef0124 100644 --- a/sys/i386/linux/linux_machdep.c +++ b/sys/i386/linux/linux_machdep.c @@ -532,6 +532,16 @@ linux_clone(struct thread *td, struct linux_clone_args *args) td->td_retval[0] = p2->p_pid; td->td_retval[1] = 0; + + if (args->flags & CLONE_VFORK) { + /* wait for the children to exit, ie. emulate vfork */ + PROC_LOCK(p2); + p2->p_flag |= P_PPWAIT; + while (p2->p_flag & P_PPWAIT) + msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0); + PROC_UNLOCK(p2); + } + return (0); } -- cgit v1.1