Fix the pthread_setname_np test.
Fix the pthread_setname_np test to take into account that emulator kernels are
so old that they don't support setting the name of other threads.
The CLONE_DETACHED thread is obsolete since 2.5 kernels.
Rename kernel_id to tid.
Fix the signature of __pthread_clone.
Clean up the clone and pthread_setname_np implementations slightly.
Change-Id: I16c2ff8845b67530544bbda9aa6618058603066d
diff --git a/libc/arch-mips/bionic/clone.S b/libc/arch-mips/bionic/clone.S
index 30fef8d..007e909 100644
--- a/libc/arch-mips/bionic/clone.S
+++ b/libc/arch-mips/bionic/clone.S
@@ -28,15 +28,15 @@
#include <linux/sched.h>
#include <sys/linux-syscalls.h>
#include <linux/errno.h>
-
+
.text
.type __pthread_clone, @function
.global __pthread_clone
.align 4
.ent __pthread_clone
-
+
/*
- * int __pthread_clone(int (*fn)(void*), void *child_stack,
+ * int __pthread_clone(void* (*fn)(void*), void *child_stack,
* int flags, void *arg);
*/
@@ -69,7 +69,7 @@
bnez $a3,.L__error
beqz $v0,.L__thread_start
-
+
j $ra
.L__thread_start:
@@ -77,7 +77,7 @@
lw $a1,4($sp) # arg
addu $a2,$sp,16 # tls
- # void __thread_entry(int (*func)(void*), void *arg, void *tls)
+ # void __thread_entry(void* (*func)(void*), void *arg, void *tls)
la $t9, __thread_entry
j $t9
@@ -125,7 +125,7 @@
bnez $a3,.L__error_bc
beqz $v0,.L__thread_start_bc
-
+
j $ra
.L__thread_start_bc:
@@ -142,4 +142,3 @@
j $t9
.end __bionic_clone
-