summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/inet/resolv.c28
-rw-r--r--libc/sysdeps/linux/common/Makefile.in6
-rw-r--r--libc/sysdeps/linux/mips/bits/syscalls.h7
3 files changed, 17 insertions, 24 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 0f6cd3532..28ebfd88b 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -1191,15 +1191,17 @@ void res_close( void )
/* This needs to be after the use of _res in res_init, above. */
#undef _res
+#ifndef __UCLIBC_HAS_THREADS__
/* The resolver state for use by single-threaded programs.
This differs from plain `struct __res_state _res;' in that it doesn't
create a common definition, but a plain symbol that resides in .bss,
which can have an alias. */
struct __res_state _res __attribute__((section (".bss")));
+#else
+struct __res_state _res __attribute__((section (".bss"))) attribute_hidden;
-#if defined __UCLIBC_HAS_THREADS_NATIVE__ \
- && (!defined NOT_IN_libc || defined IS_IN_libpthread)
-# undef __resp
+# if defined __UCLIBC_HAS_THREADS_NATIVE__
+# undef __resp
__thread struct __res_state *__resp = &_res;
/*
* FIXME: Add usage of hidden attribute for this when used in the shared
@@ -1208,13 +1210,22 @@ __thread struct __res_state *__resp = &_res;
*/
extern __thread struct __res_state *__libc_resp
__attribute__ ((alias ("__resp")));
+# else
+# undef __resp
+struct __res_state *__resp = &_res;
+# endif
#endif
#endif
#ifdef L_res_state
-# if defined __UCLIBC_HAS_THREADS_NATIVE__ \
- && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+# if defined __UCLIBC_HAS_THREADS__
+struct __res_state *
+__res_state (void)
+{
+ return __resp;
+}
+# else
# undef _res
extern struct __res_state _res;
@@ -1225,13 +1236,6 @@ __res_state (void)
{
return &_res;
}
-
-# else
-struct __res_state *
-__res_state (void)
-{
- return __resp;
-}
# endif
#endif
diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
index d4efbaaad..191d0a7aa 100644
--- a/libc/sysdeps/linux/common/Makefile.in
+++ b/libc/sysdeps/linux/common/Makefile.in
@@ -14,10 +14,6 @@ ifeq ($(EXCLUDE_BRK),y)
CSRC:=$(filter-out sbrk.c,$(CSRC))
endif
-ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
-CSRC:=$(filter-out fork.c,$(CSRC))
-endif
-
COMMON_SSP:=ssp.c ssp-local.c
# full list
@@ -34,7 +30,7 @@ CSRC:=$(filter-out $(COMMON_SSP),$(CSRC))
endif
ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
-CSRC:=$(filter-out getpid.c raise.c,$(CSRC))
+CSRC:=$(filter-out fork.c getpid.c raise.c,$(CSRC))
endif
# fails for some reason
diff --git a/libc/sysdeps/linux/mips/bits/syscalls.h b/libc/sysdeps/linux/mips/bits/syscalls.h
index 6c6c7da34..f19bd25e7 100644
--- a/libc/sysdeps/linux/mips/bits/syscalls.h
+++ b/libc/sysdeps/linux/mips/bits/syscalls.h
@@ -9,13 +9,6 @@
* programs. */
#include <bits/sysnum.h>
-#ifndef __set_errno
-# ifdef __UCLIBC_HAS_THREADS__
-# define __set_errno(val) (*__errno_location ()) = (val)
-# else
-# define __set_errno(val) (errno = (val))
-# endif
-#endif
#ifndef SYS_ify
# define SYS_ify(syscall_name) (__NR_##syscall_name)
#endif