Fix __errno for LP64 and clean up __get_tls.
If __get_tls has the right type, a lot of confusing casting can disappear.
It was probably a mistake that __get_tls was exposed as a function for mips
and x86 (but not arm), so let's (a) ensure that the __get_tls function
always matches the macro, (b) that we have the function for arm too, and
(c) that we don't have the function for any 64-bit architecture.
Change-Id: Ie9cb989b66e2006524ad7733eb6e1a65055463be
diff --git a/libc/bionic/pthread_internals.cpp b/libc/bionic/pthread_internals.cpp
index 66bc5b7..59c6e48 100644
--- a/libc/bionic/pthread_internals.cpp
+++ b/libc/bionic/pthread_internals.cpp
@@ -64,6 +64,5 @@
}
__LIBC_ABI_PRIVATE__ pthread_internal_t* __get_thread(void) {
- void** tls = reinterpret_cast<void**>(const_cast<void*>(__get_tls()));
- return reinterpret_cast<pthread_internal_t*>(tls[TLS_SLOT_THREAD_ID]);
+ return reinterpret_cast<pthread_internal_t*>(__get_tls()[TLS_SLOT_THREAD_ID]);
}