From d21497f9fba95688e464ae712bd6b4c0fbc4ea13 Mon Sep 17 00:00:00 2001 From: Austin Foxley Date: Sat, 19 Sep 2009 09:54:20 -0700 Subject: include/: add tls errno and res_state Signed-off-by: Austin Foxley --- include/errno.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'include/errno.h') diff --git a/include/errno.h b/include/errno.h index b2315b90a..85268f053 100644 --- a/include/errno.h +++ b/include/errno.h @@ -58,8 +58,24 @@ extern const char *program_invocation_name, *program_invocation_short_name; __END_DECLS -#if defined _LIBC && ( defined IS_IN_libc || defined NOT_IN_libc ) -#include +#if defined _LIBC && defined __UCLIBC_HAS_TLS__ +# if !defined NOT_IN_libc || defined IS_IN_libpthread +# undef errno +# ifndef NOT_IN_libc +# define errno __libc_errno +# else +# define errno errno /* For #ifndef errno tests. */ +# endif +extern __thread int errno attribute_tls_model_ie; +# endif +#endif + +#ifndef __set_errno +#define __set_errno(val) (errno = (val)) +#endif + +#ifndef __ASSEMBLER__ +extern int *__errno_location (void) __THROW __attribute__ ((__const__)); #endif #endif /* _ERRNO_H */ -- cgit v1.2.3