From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KWgpg-00025g-3o for qemu-devel@nongnu.org; Fri, 22 Aug 2008 20:18:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KWgpe-00025M-4i for qemu-devel@nongnu.org; Fri, 22 Aug 2008 20:18:19 -0400 Received: from [199.232.76.173] (port=35738 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWgpe-00025J-2S for qemu-devel@nongnu.org; Fri, 22 Aug 2008 20:18:18 -0400 Received: from ik-out-1112.google.com ([66.249.90.177]:46940) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KWgpd-0003Ps-OA for qemu-devel@nongnu.org; Fri, 22 Aug 2008 20:18:17 -0400 Received: by ik-out-1112.google.com with SMTP id c21so540270ika.2 for ; Fri, 22 Aug 2008 17:18:16 -0700 (PDT) From: "Kirill A. Shutemov" Date: Sat, 23 Aug 2008 03:18:25 +0300 Message-Id: <1219450705-1376-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" , Paul Brook 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 fd4890e..2abdc83 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2787,7 +2787,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; @@ -2856,8 +2856,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