Instead of using fork(), call syscall(__NR_fork) in step-fork.c
to avoid looping on powerpc arch in libc.

Signed-off-by: Veaceslav Falico <vfal...@redhat.com>
---

--- ptrace-tests/tests/step-fork.c      2009-12-01 17:17:14.000000000 +0100
+++ ptrace-tests/tests/step-fork.c      2009-12-01 17:25:12.000000000 +0100
@@ -29,6 +29,7 @@
 #include <unistd.h>
 #include <sys/wait.h>
 #include <string.h>
+#include <sys/syscall.h>
 #include <signal.h>
 
 #ifndef PTRACE_SINGLESTEP
@@ -78,7 +79,12 @@ main (int argc, char **argv)
        sigprocmask (SIG_BLOCK, &mask, NULL);
        ptrace (PTRACE_TRACEME);
        raise (SIGUSR1);
-       if (fork () == 0)
+
+       /*
+       * We can't use fork() directly because on powerpc it loops inside libc 
on 
+       * ptrace over utrace. See http://lkml.org/lkml/2009/11/28/11
+       */
+       if (syscall(__NR_fork) == 0)
          {
            read (-1, NULL, 0);
            _exit (22);

Reply via email to