From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KXHv2-0005xV-DH for qemu-devel@nongnu.org; Sun, 24 Aug 2008 11:54:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KXHv0-0005ws-SI for qemu-devel@nongnu.org; Sun, 24 Aug 2008 11:54:19 -0400 Received: from [199.232.76.173] (port=49201 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KXHv0-0005wp-Oi for qemu-devel@nongnu.org; Sun, 24 Aug 2008 11:54:18 -0400 Received: from nf-out-0910.google.com ([64.233.182.187]:25822) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KXHv0-0004Bp-C1 for qemu-devel@nongnu.org; Sun, 24 Aug 2008 11:54:18 -0400 Received: by nf-out-0910.google.com with SMTP id b2so623133nfb.12 for ; Sun, 24 Aug 2008 08:54:17 -0700 (PDT) From: "Kirill A. Shutemov" Date: Sun, 24 Aug 2008 18:54:29 +0300 Message-Id: <1219593269-2622-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..8a00734 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