From bf2cc5fb028fecf8d6b1adffd952f7402f685923 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 24 Nov 2002 23:56:47 +0000 Subject: * sysdeps/posix/readv.c: Include , use __set_errno macro. * sysdeps/posix/writev.c: Likewise. From Momchil Velikov . * elf/dl-error.c [! _LIBC_REENTRANT]: Use a static variable instead of calling *GL(dl_error_catch_tsd) for a thread-local location. * elf/rtld.c (startup_error_tsd): Conditionalize on [_LIBC_REENTRANT]. (dl_main): Same for GL(dl_error_catch_tsd) initialization. * elf/dl-tsd.c: Conditionalize contents on [_LIBC_REENTRANT]. * libio/iofflush.c: Add libc_hidden_def. * libio/iofwrite.c: Likewise. * sysdeps/generic/sigtimedwait.c: Likewise. * sysdeps/generic/sigwaitinfo.c: Likewise. * sysdeps/posix/sigwait.c: Likewise. Reported by Momchil Velikov . * inet/inet_lnaof.c (inet_lnaof): Change return type to in_addr_t to match declaration. * inet/inet_netof.c (inet_netof): Likewise. * inet/inet_mkadr.c (inet_makeaddr): Likewise for argument types. Reported by Momchil Velikov . --- elf/dl-tsd.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'elf/dl-tsd.c') diff --git a/elf/dl-tsd.c b/elf/dl-tsd.c index aa290a7961..c60cd1a760 100644 --- a/elf/dl-tsd.c +++ b/elf/dl-tsd.c @@ -17,10 +17,12 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include -#include +#ifdef _LIBC_REENTRANT -#ifndef SHARED +# include +# include + +# ifndef SHARED /* _dl_error_catch_tsd points to this for the single-threaded case. It's reset by the thread library for multithreaded programs @@ -28,17 +30,17 @@ static void ** __attribute__ ((const)) startup_error_tsd (void) { -#if USE___THREAD +# if USE___THREAD static __thread void *data; -#else +# else static void *data; -#endif +# endif return &data; } void **(*_dl_error_catch_tsd) (void) __attribute__ ((const)) = &startup_error_tsd; -#elif USE___THREAD +# elif USE___THREAD /* libpthread sets _dl_error_catch_tsd to point to this function. We define it here instead of in libpthread so that it doesn't @@ -51,4 +53,6 @@ __libc_dl_error_tsd (void) return &data; } -#endif +# endif /* SHARED */ + +#endif /* _LIBC_REENTRANT */ -- cgit v1.2.3