about summary refs log tree commit diff
path: root/include/errno.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/errno.h')
-rw-r--r--include/errno.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/include/errno.h b/include/errno.h
index 35f705100e..9969b1f519 100644
--- a/include/errno.h
+++ b/include/errno.h
@@ -1,13 +1,20 @@
+#ifndef _ERRNO_H
+
 #include <stdlib/errno.h>
 
 #ifdef _ERRNO_H
 
-#if USE_TLS && HAVE___THREAD
-# undef errno
+# include <tls.h>		/* Defines USE_TLS.  */
+
+# if USE_TLS && HAVE___THREAD
+#  undef  errno
+#  define errno errno		/* For #ifndef errno tests.  */
 extern __thread int errno;
-# define __set_errno(val) (errno = (val))
-#else
-# define __set_errno(val) (*__errno_location ()) = (val)
-#endif
+#  define __set_errno(val) (errno = (val))
+# else
+#  define __set_errno(val) (*__errno_location ()) = (val)
+# endif
+
+#endif /* _ERRNO_H */
 
-#endif
+#endif /* ! _ERRNO_H */