|
From: Steve V.
|
This patch handles more combinations of flag arguments to clone(),
specifically more variations of VKI_CLONE_FILES and VKI_CLONE_FS are allowed.
Index: valgrind/coregrind/m_syswrap/syswrap-linux.c
===================================================================
--- valgrind.orig/coregrind/m_syswrap/syswrap-linux.c 2008-08-21 16:13:08.000000000 -0700
+++ valgrind/coregrind/m_syswrap/syswrap-linux.c 2008-08-21 16:28:12.000000000 -0700
@@ -307,7 +307,7 @@
SysRes res;
if (flags & (VKI_CLONE_SETTLS | VKI_CLONE_FS | VKI_CLONE_VM
- | VKI_CLONE_FILES | VKI_CLONE_VFORK))
+ | VKI_CLONE_VFORK))
return VG_(mk_SysRes_Error)( VKI_EINVAL );
/* Block all signals during fork, so that we can fix things up in
Index: valgrind/coregrind/m_syswrap/syswrap-x86-linux.c
===================================================================
--- valgrind.orig/coregrind/m_syswrap/syswrap-x86-linux.c 2008-08-21 16:06:25.000000000 -0700
+++ valgrind/coregrind/m_syswrap/syswrap-x86-linux.c 2008-08-21 16:32:26.000000000 -0700
@@ -905,6 +905,7 @@
switch (cloneflags & (VKI_CLONE_VM | VKI_CLONE_FS
| VKI_CLONE_FILES | VKI_CLONE_VFORK)) {
case VKI_CLONE_VM | VKI_CLONE_FS | VKI_CLONE_FILES:
+ case VKI_CLONE_VM | VKI_CLONE_FILES:
/* thread creation */
SET_STATUS_from_SysRes(
do_clone(tid,
@@ -915,6 +916,7 @@
(vki_modify_ldt_t *)ARG4)); /* set_tls */
break;
+ case VKI_CLONE_FILES: /* fork with shared fd's */
case VKI_CLONE_VFORK | VKI_CLONE_VM: /* vfork */
/* FALLTHROUGH - assume vfork == fork */
cloneflags &= ~(VKI_CLONE_VFORK | VKI_CLONE_VM);
|