about summary refs log tree commit diff
path: root/linuxthreads/errno.c
diff options
context:
space:
mode:
Diffstat (limited to 'linuxthreads/errno.c')
-rw-r--r--linuxthreads/errno.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/linuxthreads/errno.c b/linuxthreads/errno.c
index 0eb98ac20c..c74e4c45c9 100644
--- a/linuxthreads/errno.c
+++ b/linuxthreads/errno.c
@@ -17,14 +17,18 @@
 #include <errno.h>
 #include <netdb.h>
 #include <resolv.h>
+#include <tls.h>
 #include "pthread.h"
 #include "internals.h"
 
+#if !USE_TLS || !HAVE___THREAD
+/* The definition in libc is sufficient if we use TLS.  */
 int * __errno_location()
 {
   pthread_descr self = thread_self();
   return THREAD_GETMEM (self, p_errnop);
 }
+#endif
 
 int * __h_errno_location()
 {