diff options
| -rw-r--r-- | include/resolv.h | 2 | ||||
| -rw-r--r-- | libc/inet/resolv.c | 28 | ||||
| -rw-r--r-- | libc/sysdeps/linux/common/Makefile.in | 6 | ||||
| -rw-r--r-- | libc/sysdeps/linux/mips/bits/syscalls.h | 7 | ||||
| -rw-r--r-- | libpthread/nptl/Makefile.in | 6 | ||||
| -rw-r--r-- | libpthread/nptl/old_pthread_atfork.c | 27 | ||||
| -rw-r--r-- | libpthread/nptl/pthread_atfork.c | 11 | ||||
| -rw-r--r-- | libpthread/nptl/sysdeps/unix/sysv/linux/register-atfork.c | 29 |
8 files changed, 20 insertions, 96 deletions
diff --git a/include/resolv.h b/include/resolv.h index 3658930c8..7ab401394 100644 --- a/include/resolv.h +++ b/include/resolv.h @@ -398,7 +398,7 @@ extern __thread struct __res_state *__resp attribute_tls_model_ie; # endif # else # undef _res -extern struct __res_state _res; +# define _res (*__resp) # endif /* __UCLIBC_HAS_THREADS_NATIVE__ */ # endif /* __UCLIBC_HAS_THREADS__ */ # endif /* _LIBC */ 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 diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in index 53f684d39..45f3bd1f2 100644 --- a/libpthread/nptl/Makefile.in +++ b/libpthread/nptl/Makefile.in @@ -64,7 +64,7 @@ libpthread-routines = init vars events version \ pthread_cancel pthread_testcancel \ pthread_setcancelstate pthread_setcanceltype \ pthread_once \ - old_pthread_atfork pthread_atfork \ + pthread_atfork \ pthread_getcpuclockid \ pthread_clock_gettime pthread_clock_settime \ sem_init sem_destroy \ @@ -94,7 +94,6 @@ libpthread-routines = init vars events version \ cleanup_routine unwind-forcedunwind libpthread-shared-only-routines = version pt-allocrtsig unwind-forcedunwind -libpthread-static-only-routines = pthread_atfork CFLAGS-pthread_atfork.c = -DNOT_IN_libc @@ -234,8 +233,7 @@ libpthread_a_SRC = $(patsubst %, $(libpthread_DIR)/%.c, \ $(libpthread-routines))) libpthread_so_SRC = $(patsubst %, $(libpthread_DIR)/%.c, \ $(filter-out $(libpthread-os-routines) \ - $(libpthread-misc-routines) \ - $(libpthread-static-only-routines), $(libpthread-routines))) + $(libpthread-misc-routines), $(libpthread-routines))) libc-a-y += $(patsubst %.c, $(libpthread_OUT)/%.o, alloca_cutoff.c \ forward.c libc-cancellation.c) diff --git a/libpthread/nptl/old_pthread_atfork.c b/libpthread/nptl/old_pthread_atfork.c deleted file mode 100644 index 768e6876c..000000000 --- a/libpthread/nptl/old_pthread_atfork.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <shlib-compat.h> - -#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_3) -# define __pthread_atfork __dyn_pthread_atfork -# include "pthread_atfork.c" -# undef __pthread_atfork -compat_symbol (libpthread, __dyn_pthread_atfork, pthread_atfork, GLIBC_2_0); -#endif diff --git a/libpthread/nptl/pthread_atfork.c b/libpthread/nptl/pthread_atfork.c index 6437d6490..e0fc3cf75 100644 --- a/libpthread/nptl/pthread_atfork.c +++ b/libpthread/nptl/pthread_atfork.c @@ -41,13 +41,6 @@ extern void *__dso_handle __attribute__ ((__weak__)); -/* Hide the symbol so that no definition but the one locally in the - executable or DSO is used. */ -int -#ifndef __pthread_atfork -/* Don't mark the compatibility function as hidden. */ -attribute_hidden -#endif __pthread_atfork (prepare, parent, child) void (*prepare) (void); void (*parent) (void); @@ -56,8 +49,4 @@ __pthread_atfork (prepare, parent, child) return __register_atfork (prepare, parent, child, &__dso_handle == NULL ? NULL : __dso_handle); } -#ifndef __pthread_atfork -extern int pthread_atfork (void (*prepare) (void), void (*parent) (void), - void (*child) (void)) attribute_hidden; strong_alias (__pthread_atfork, pthread_atfork) -#endif diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/register-atfork.c b/libpthread/nptl/sysdeps/unix/sysv/linux/register-atfork.c index a3bb3c34c..18b9893d9 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/register-atfork.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/register-atfork.c @@ -106,32 +106,3 @@ __register_atfork (prepare, parent, child, dso_handle) return newp == NULL ? ENOMEM : 0; } -hidden_def (__register_atfork) - - -#ifndef __UCLIBC__ -libc_freeres_fn (free_mem) -{ - /* Get the lock to not conflict with running forks. */ - lll_lock (__fork_lock); - - /* No more fork handlers. */ - __fork_handlers = NULL; - - /* Free eventually alloated memory blocks for the object pool. */ - struct fork_handler_pool *runp = fork_handler_pool.next; - - memset (&fork_handler_pool, '\0', sizeof (fork_handler_pool)); - - /* Release the lock. */ - lll_unlock (__fork_lock); - - /* We can free the memory after releasing the lock. */ - while (runp != NULL) - { - struct fork_handler_pool *oldp = runp; - runp = runp->next; - free (oldp); - } -} -#endif |
