about summary refs log tree commit diff
path: root/linuxthreads/sysdeps/pthread/bits/libc-tsd.h
diff options
context:
space:
mode:
Diffstat (limited to 'linuxthreads/sysdeps/pthread/bits/libc-tsd.h')
-rw-r--r--linuxthreads/sysdeps/pthread/bits/libc-tsd.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/linuxthreads/sysdeps/pthread/bits/libc-tsd.h b/linuxthreads/sysdeps/pthread/bits/libc-tsd.h
index 7a532ea74c..79808a5b4d 100644
--- a/linuxthreads/sysdeps/pthread/bits/libc-tsd.h
+++ b/linuxthreads/sysdeps/pthread/bits/libc-tsd.h
@@ -1,5 +1,5 @@
 /* libc-internal interface for thread-specific data.  LinuxThreads version.
-   Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1997,98,99,2001,02 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -20,13 +20,21 @@
 #ifndef _BITS_LIBC_TSD_H
 #define _BITS_LIBC_TSD_H 1
 
-
 /* Fast thread-specific data internal to libc.  */
 enum __libc_tsd_key_t { _LIBC_TSD_KEY_MALLOC = 0,
 			_LIBC_TSD_KEY_DL_ERROR,
 			_LIBC_TSD_KEY_RPC_VARS,
 			_LIBC_TSD_KEY_N };
 
+#include <tls.h>
+
+#if USE_TLS && HAVE___THREAD
+
+/* When __thread works, the generic definition is what we want.  */
+# include <sysdeps/generic/bits/libc-tsd.h>
+
+#else
+
 extern void *(*__libc_internal_tsd_get) (enum __libc_tsd_key_t) __THROW;
 extern int (*__libc_internal_tsd_set) (enum __libc_tsd_key_t,
 				       __const void *)  __THROW;
@@ -41,4 +49,6 @@ extern int (*__libc_internal_tsd_set) (enum __libc_tsd_key_t,
    ? __libc_internal_tsd_set (_LIBC_TSD_KEY_##KEY, (VALUE)) \
    : ((__libc_tsd_##KEY##_data = (VALUE)), 0))
 
+#endif
+
 #endif	/* bits/libc-tsd.h */