From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KgL5M-00044b-Jn for qemu-devel@nongnu.org; Thu, 18 Sep 2008 11:06:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KgL5L-00043d-Ea for qemu-devel@nongnu.org; Thu, 18 Sep 2008 11:06:23 -0400 Received: from [199.232.76.173] (port=56910 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KgL5L-00043V-96 for qemu-devel@nongnu.org; Thu, 18 Sep 2008 11:06:23 -0400 Received: from nf-out-0910.google.com ([64.233.182.184]:31978) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KgL5K-0005Zm-RO for qemu-devel@nongnu.org; Thu, 18 Sep 2008 11:06:23 -0400 Received: by nf-out-0910.google.com with SMTP id b2so2294204nfb.12 for ; Thu, 18 Sep 2008 08:06:22 -0700 (PDT) From: "Kirill A. Shutemov" Date: Thu, 18 Sep 2008 18:06:59 +0300 Message-Id: <1221750426-14863-1-git-send-email-kirill@shutemov.name> Subject: [Qemu-devel] [PATCH] Fix vfork() syscall emulation Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Kirill A. Shutemov" vfork() is a kind of fork, not thread despite CLONE_VM Signed-off-by: Kirill A. Shutemov --- linux-user/syscall.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 56b4138..124d14e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2788,7 +2788,7 @@ static int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp, sigset_t sigmask; #endif - if (flags & CLONE_VM) { + if (!(flags & CLONE_VFORK) && (flags & CLONE_VM)) { #if defined(USE_NPTL) new_thread_info info; pthread_attr_t attr; @@ -2857,8 +2857,8 @@ static int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp, #endif #endif } else { - /* if no CLONE_VM, we consider it is a fork */ - if ((flags & ~(CSIGNAL | CLONE_NPTL_FLAGS2)) != 0) + /* we consider it is a fork or vfork */ + if ((flags & ~(CSIGNAL | CLONE_NPTL_FLAGS2 | CLONE_VFORK | CLONE_VM)) != 0) return -EINVAL; fork_start(); ret = fork(); -- 1.5.6.5.GIT