From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KchKl-0007w8-7a for qemu-devel@nongnu.org; Mon, 08 Sep 2008 10:03:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KchKf-0007u9-O4 for qemu-devel@nongnu.org; Mon, 08 Sep 2008 10:03:13 -0400 Received: from [199.232.76.173] (port=39226 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KchKf-0007u6-Lf for qemu-devel@nongnu.org; Mon, 08 Sep 2008 10:03:09 -0400 Received: from gv-out-0910.google.com ([216.239.58.191]:33180) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KchKf-0007FW-3a for qemu-devel@nongnu.org; Mon, 08 Sep 2008 10:03:09 -0400 Received: by gv-out-0910.google.com with SMTP id n8so222137gve.36 for ; Mon, 08 Sep 2008 07:03:05 -0700 (PDT) From: "Kirill A. Shutemov" Date: Mon, 8 Sep 2008 17:03:29 +0300 Message-Id: <1220882616-18735-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 eba2c02..ae7a5a2 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