[PATCH] ptrace-tests: fix step-fork.c on powerpc for ptrace-utrace

2009-12-01 Thread Veaceslav Falico
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.0 +0100
+++ ptrace-tests/tests/step-fork.c  2009-12-01 17:25:12.0 +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);



Re: [PATCH] ptrace-tests: fix step-fork.c on powerpc for ptrace-utrace

2009-12-01 Thread Veaceslav Falico
On Tue, Dec 01, 2009 at 05:37:48PM +0100, Veaceslav Falico wrote:

 - 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);


Sorry, the comment is just wrong. I'll resend the patch in several minutes.

--
Veaceslav