]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix so that new versions of system (using clone()) work.
authorNicholas Nethercote <n.nethercote@gmail.com>
Sun, 15 Feb 2004 16:15:05 +0000 (16:15 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Sun, 15 Feb 2004 16:15:05 +0000 (16:15 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2253

coregrind/vg_syscalls.c
none/tests/system.c [new file with mode: 0644]
none/tests/system.stderr.exp [new file with mode: 0644]
none/tests/system.vgtest [new file with mode: 0644]

index ca6b48e328d8875c352229c51b67939d75403cfe..35e2a18e575208777f91394a8c80b18eaaaf5596 100644 (file)
@@ -2240,7 +2240,9 @@ PRE(clone)
    MAYBE_PRINTF("clone ( %d, %p, %p, %p, %p )\n",arg1,arg2,arg3,arg4,arg5);
 
    if (arg2 == 0 &&
-       arg1 == (VKI_CLONE_CHILD_CLEARTID|VKI_CLONE_CHILD_SETTID|VKI_SIGCHLD)) {
+       (arg1 == (VKI_CLONE_CHILD_CLEARTID|VKI_CLONE_CHILD_SETTID|VKI_SIGCHLD)
+     || arg1 == (VKI_CLONE_PARENT_SETTID|VKI_SIGCHLD))) 
+   {
       before_fork(tid, tst);
       res = VG_(do_syscall)(SYSNO, arg1, arg2, arg3, arg4, arg5);
       after_fork(tid, tst);
diff --git a/none/tests/system.c b/none/tests/system.c
new file mode 100644 (file)
index 0000000..3b906c3
--- /dev/null
@@ -0,0 +1,10 @@
+#include <stdlib.h>
+
+// This wasn't working at one point, because glibc used a variant of clone()
+// to implement system(), which Valgrind didn't accept.
+
+int main(void)
+{
+   system("../../tests/true");
+   return 0;
+}
diff --git a/none/tests/system.stderr.exp b/none/tests/system.stderr.exp
new file mode 100644 (file)
index 0000000..139597f
--- /dev/null
@@ -0,0 +1,2 @@
+
+
diff --git a/none/tests/system.vgtest b/none/tests/system.vgtest
new file mode 100644 (file)
index 0000000..74d9b5b
--- /dev/null
@@ -0,0 +1 @@
+prog: system