svn commit: branches/uClibc-nptl: include libc/inet libc/misc/internals
sjhill at uclibc.org
sjhill at uclibc.org
Tue Dec 13 04:53:17 UTC 2005
Author: sjhill
Date: 2005-12-12 20:53:11 -0800 (Mon, 12 Dec 2005)
New Revision: 12851
Log:
Clean-up definition and usage of h_errno to be a TLS variable.
Modified:
branches/uClibc-nptl/include/netdb.h
branches/uClibc-nptl/libc/inet/resolv.c
branches/uClibc-nptl/libc/misc/internals/__h_errno_location.c
Changeset:
Modified: branches/uClibc-nptl/include/netdb.h
===================================================================
--- branches/uClibc-nptl/include/netdb.h 2005-12-13 04:11:05 UTC (rev 12850)
+++ branches/uClibc-nptl/include/netdb.h 2005-12-13 04:53:11 UTC (rev 12851)
@@ -54,15 +54,8 @@
__BEGIN_DECLS
/* Error status for non-reentrant lookup functions.
- We use a macro to access always the thread-specific `h_errno' variable.
- We always need the extern int here in case internal libc code undefines
- the macro because it needs access to the underlying storage. */
-#if !defined(__UCLIBC_HAS_THREADS_NATIVE__)
-extern int h_errno;
-#endif
-#if defined(__UCLIBC_HAS_THREADS__)
-# define h_errno (*__h_errno_location ())
-#endif
+ We use a macro to access always the thread-specific `h_errno' variable. */
+#define h_errno (*__h_errno_location ())
/* Function to get address of global `h_errno' variable. */
extern int *__h_errno_location (void) __THROW __attribute__ ((__const__));
@@ -657,13 +650,4 @@
__END_DECLS
-#ifdef _LIBC
-# ifdef __UCLIBC_HAS_THREADS_NATIVE__
-# include <tls.h>
-# undef h_errno
-# define h_errno h_errno /* For #ifndef h_errno tests. */
-extern __thread int h_errno attribute_tls_model_ie;
-# endif
-#endif
-
#endif /* netdb.h */
Modified: branches/uClibc-nptl/libc/inet/resolv.c
===================================================================
--- branches/uClibc-nptl/libc/inet/resolv.c 2005-12-13 04:11:05 UTC (rev 12850)
+++ branches/uClibc-nptl/libc/inet/resolv.c 2005-12-13 04:53:11 UTC (rev 12851)
@@ -1145,7 +1145,6 @@
}
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
-#include <tls.h>
__thread struct __res_state *__resp = &_res;
#endif
Modified: branches/uClibc-nptl/libc/misc/internals/__h_errno_location.c
===================================================================
--- branches/uClibc-nptl/libc/misc/internals/__h_errno_location.c 2005-12-13 04:11:05 UTC (rev 12850)
+++ branches/uClibc-nptl/libc/misc/internals/__h_errno_location.c 2005-12-13 04:53:11 UTC (rev 12851)
@@ -3,6 +3,12 @@
#include <netdb.h>
#undef h_errno
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+extern __thread int h_errno;
+#else
+extern int h_errno;
+#endif
+
int * weak_const_function __h_errno_location (void)
{
return &h_errno;
More information about the uClibc-cvs
mailing list