From 25f4ae1de711b2001b4958d65e77b6dba222e7b5 Mon Sep 17 00:00:00 2001 From: Alexey Brodkin Date: Fri, 29 Jul 2016 12:17:18 +0300 Subject: arc: clone: Recover PID correctly Caught by tst-getpid1 test from uClibc's test-suite. It looks like original implementation was not correct. The code in question is supposed to recover PID of the new thread. And by no means that could happen with clone() syscall while getpid() does exactly this. Signed-off-by: Alexey Brodkin Acked-by: Vineet Gupta Reported-by: Eugeniy Paltsev --- libc/sysdeps/linux/arc/clone.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc') diff --git a/libc/sysdeps/linux/arc/clone.S b/libc/sysdeps/linux/arc/clone.S index 3c1388ec7..dbb3fa756 100644 --- a/libc/sysdeps/linux/arc/clone.S +++ b/libc/sysdeps/linux/arc/clone.S @@ -72,7 +72,7 @@ ENTRY(clone) and_s r2, r2, r12 brne r2, r12, .Lgo_thread - mov r8, __NR_clone + mov r8, __NR_getpid ARC_TRAP_INSN ; r0 has PID THREAD_SELF r1 ; Get to struct pthread (just before TCB) st r0, [r1, PTHREAD_PID] -- cgit v1.2.3