Move errno to a pthread_internal_t field.
This change is intended to allow native-bridge to use independent
TLS memory for host and guest environments, while still sharing a
thread-local errno between the two.
Bug: http://b/78026329
Test: bionic unit tests
Change-Id: I838cd321e159add60760bc12a8aa7e9ddc960c33
diff --git a/libc/bionic/pthread_internal.h b/libc/bionic/pthread_internal.h
index 2ebd2b4..4c13dcb 100644
--- a/libc/bionic/pthread_internal.h
+++ b/libc/bionic/pthread_internal.h
@@ -145,6 +145,8 @@
bionic_tls* bionic_tls;
+ int errno_value;
+
// The thread pointer (__get_tls()) points at this field. This field must come last so that
// an executable's TLS segment can be allocated at a fixed offset after the thread pointer.
void* tls[BIONIC_TLS_SLOTS];