summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormirabilos <m@mirbsd.org>2017-01-29 13:22:02 (GMT)
committerWaldemar Brodkorb <wbx@openadk.org>2017-02-01 16:49:03 (GMT)
commitdc79afc0facb5de24d63fbaba6a345222a86d0d5 (patch)
treec66dc513afe1d37703167cd291243fb70968fafa
parentdba942c80dc2cfa5768a856fff98e22a755fdd27 (diff)
g/c __libc_errno
Signed-off-by: mirabilos <m@mirbsd.org> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
-rw-r--r--include/errno.h4
-rw-r--r--libc/misc/internals/errno.c3
-rw-r--r--libc/sysdeps/linux/aarch64/sysdep.h4
-rw-r--r--libc/sysdeps/linux/i386/sysdep.h4
-rw-r--r--libc/sysdeps/linux/sh/sysdep.h4
-rw-r--r--libc/sysdeps/linux/x86_64/sysdep.h4
-rw-r--r--libc/sysdeps/linux/xtensa/sysdep.h4
7 files changed, 1 insertions, 26 deletions
diff --git a/include/errno.h b/include/errno.h
index 4e3a816..380a0b7 100644
--- a/include/errno.h
+++ b/include/errno.h
@@ -70,11 +70,7 @@ extern int _dl_errno; /* attribute_hidden */
#elif 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
diff --git a/libc/misc/internals/errno.c b/libc/misc/internals/errno.c
index d990885..442f43f 100644
--- a/libc/misc/internals/errno.c
+++ b/libc/misc/internals/errno.c
@@ -3,8 +3,7 @@
#undef errno
#ifdef __UCLIBC_HAS_TLS__
-__thread int errno;
-extern __thread int __libc_errno __attribute__ ((alias ("errno"))) attribute_hidden;
+__thread int errno attribute_tls_model_ie;
#else
extern int errno;
int errno = 0;
diff --git a/libc/sysdeps/linux/aarch64/sysdep.h b/libc/sysdeps/linux/aarch64/sysdep.h
index 82790be..177b0f1 100644
--- a/libc/sysdeps/linux/aarch64/sysdep.h
+++ b/libc/sysdeps/linux/aarch64/sysdep.h
@@ -114,11 +114,7 @@ END (name)
#if defined _LIBC_REENTRANT
# if defined USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
# define SYSCALL_ERROR_ERRNO errno
-# endif
# endif
#endif
diff --git a/libc/sysdeps/linux/i386/sysdep.h b/libc/sysdeps/linux/i386/sysdep.h
index c15c1b4..0866894 100644
--- a/libc/sysdeps/linux/i386/sysdep.h
+++ b/libc/sysdeps/linux/i386/sysdep.h
@@ -189,11 +189,7 @@ __x86.get_pc_thunk.reg: \
# if defined _LIBC_REENTRANT
# if defined USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
# define SYSCALL_ERROR_ERRNO errno
-# endif
# define SYSCALL_ERROR_HANDLER \
0:SETUP_PIC_REG (cx); \
addl $_GLOBAL_OFFSET_TABLE_, %ecx; \
diff --git a/libc/sysdeps/linux/sh/sysdep.h b/libc/sysdeps/linux/sh/sysdep.h
index 56fa3f7..42dc00e 100644
--- a/libc/sysdeps/linux/sh/sysdep.h
+++ b/libc/sysdeps/linux/sh/sysdep.h
@@ -134,11 +134,7 @@
# if defined USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
# define SYSCALL_ERROR_ERRNO errno
-# endif
# define SYSCALL_ERROR_HANDLER \
neg r0,r1; \
mov r12,r2; \
diff --git a/libc/sysdeps/linux/x86_64/sysdep.h b/libc/sysdeps/linux/x86_64/sysdep.h
index 61d2be8..34c0435 100644
--- a/libc/sysdeps/linux/x86_64/sysdep.h
+++ b/libc/sysdeps/linux/x86_64/sysdep.h
@@ -168,11 +168,7 @@ lose: \
# ifndef __PIC__
# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
# elif USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
# define SYSCALL_ERROR_ERRNO errno
-# endif
# define SYSCALL_ERROR_HANDLER \
0: \
movq SYSCALL_ERROR_ERRNO@GOTTPOFF(%rip), %rcx;\
diff --git a/libc/sysdeps/linux/xtensa/sysdep.h b/libc/sysdeps/linux/xtensa/sysdep.h
index 8d1bfcf..0671f07 100644
--- a/libc/sysdeps/linux/xtensa/sysdep.h
+++ b/libc/sysdeps/linux/xtensa/sysdep.h
@@ -150,11 +150,7 @@
#if defined _LIBC_REENTRANT
# if defined USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
# define SYSCALL_ERROR_ERRNO errno
-# endif
# define SYSCALL_ERROR_HANDLER \
0: rur a4, THREADPTR; \
movi a3, SYSCALL_ERROR_ERRNO@TPOFF; \