qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] Fix vfork() syscall emulation


From: Kirill A. Shutemov
Subject: [Qemu-devel] [PATCH] Fix vfork() syscall emulation
Date: Thu, 18 Sep 2008 18:06:59 +0300

vfork() is a kind of fork, not thread despite CLONE_VM

Signed-off-by: Kirill A. Shutemov <address@hidden>
---
 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]