[Top][All Lists]
[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: |
Sun, 24 Aug 2008 18:54:29 +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 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