diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2011-03-25 00:49:42 +0100 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2012-06-15 14:00:33 +0200 |
commit | f418f52701de02954c90341e5c9ccdd3f07ccd33 (patch) | |
tree | 1a8c1e1d5f9ac406f2f76d39edd4b2f47977c905 /libc/misc/internals/__errno_location.c | |
parent | 4341f1d5233858bf421ff5863ac92d4448a0e0a6 (diff) |
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 <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/misc/internals/__errno_location.c')
-rw-r--r-- | libc/misc/internals/__errno_location.c | 10 |
1 files changed, 8 insertions, 2 deletions
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 <features.h> +#include <errno.h> + +#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) |