From f418f52701de02954c90341e5c9ccdd3f07ccd33 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Fri, 25 Mar 2011 00:49:42 +0100 Subject: errno, h_errno: correct them for non-TLS Move h_errno related stuff to separate file. Do not hide errno and h_errno for non-TLS, else it keeps being 0. Make __[h_]errno_location weak for non-TLS. Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- libc/misc/internals/__errno_location.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libc/misc/internals/__errno_location.c') diff --git a/libc/misc/internals/__errno_location.c b/libc/misc/internals/__errno_location.c index 340950037..dec913f30 100644 --- a/libc/misc/internals/__errno_location.c +++ b/libc/misc/internals/__errno_location.c @@ -4,10 +4,16 @@ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ -#include "internal_errno.h" +#include +#include + +#ifndef __UCLIBC_HAS_TLS__ +# undef errno +extern int errno; +#endif int *__errno_location(void) { return &errno; } -libc_hidden_weak(__errno_location) +libc_hidden_def(__errno_location) -- cgit v1.2.3