summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Brodkin <Alexey.Brodkin@synopsys.com>2016-07-29 09:17:18 (GMT)
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-07-31 10:50:54 (GMT)
commit25f4ae1de711b2001b4958d65e77b6dba222e7b5 (patch)
tree223fae89584a3cfede3e2df707e0966be8398cce
parentae01de4d1d1e16e46c5180ba7fb081792081996a (diff)
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 <abrodkin@synopsys.com> Acked-by: Vineet Gupta <vgupta@synopsys.com> Reported-by: Eugeniy Paltsev <paltsev@synopsys.com>
-rw-r--r--libc/sysdeps/linux/arc/clone.S2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/arc/clone.S b/libc/sysdeps/linux/arc/clone.S
index 3c1388e..dbb3fa7 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]