summaryrefslogtreecommitdiff
path: root/libpthread
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2006-01-31 14:41:37 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2006-01-31 14:41:37 +0000
commit8c2b377d28710215838741cd9778c8e7229ebf26 (patch)
treed24bddc26b796f7665f10720a0c5242f0f968541 /libpthread
parentda6cf3047ecad6e3f2483932134640a77a2c3556 (diff)
s/IS_IN_linuxthreads/IS_IN_libpthread/, some prototypes, correct Makefile.in, disable __res_state, unavailable in resolv.h
Diffstat (limited to 'libpthread')
-rw-r--r--libpthread/linuxthreads/Makefile.in28
-rw-r--r--libpthread/linuxthreads/errno.c2
-rw-r--r--libpthread/linuxthreads/forward.c8
-rw-r--r--libpthread/linuxthreads/internals.h10
-rw-r--r--libpthread/linuxthreads/ptcleanup.c1
-rw-r--r--libpthread/linuxthreads/pthread.c3
-rw-r--r--libpthread/linuxthreads/pthread_setegid.c1
-rw-r--r--libpthread/linuxthreads/pthread_seteuid.c1
-rw-r--r--libpthread/linuxthreads/pthread_setgid.c1
-rw-r--r--libpthread/linuxthreads/pthread_setregid.c1
-rw-r--r--libpthread/linuxthreads/pthread_setresgid.c1
-rw-r--r--libpthread/linuxthreads/pthread_setresuid.c1
-rw-r--r--libpthread/linuxthreads/pthread_setreuid.c1
-rw-r--r--libpthread/linuxthreads/pthread_setuid.c1
-rw-r--r--libpthread/linuxthreads/signals.c2
-rw-r--r--libpthread/linuxthreads/sysdeps/i386/pt-machine.h3
-rw-r--r--libpthread/linuxthreads/sysdeps/i386/tls.h2
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h4
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h1
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h1
-rw-r--r--libpthread/linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c1
21 files changed, 47 insertions, 27 deletions
diff --git a/libpthread/linuxthreads/Makefile.in b/libpthread/linuxthreads/Makefile.in
index 94926a3af..7aa891517 100644
--- a/libpthread/linuxthreads/Makefile.in
+++ b/libpthread/linuxthreads/Makefile.in
@@ -1,13 +1,12 @@
# Makefile for uClibc
#
# Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
-# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CFLAGS-linuxthreads := -DNOT_IN_libc $(SSP_ALL_CFLAGS)
-CFLAGS-linuxthreads += -DIS_IN_linuxthreads=1 -D_GNU_SOURCE
+CFLAGS-linuxthreads := -DNOT_IN_libc -DIS_IN_libpthread $(SSP_ALL_CFLAGS)
CFLAGS-libpthread/linuxthreads/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads)
CFLAGS-libpthread/linuxthreads/sysdeps/unix/sysv/linux/ := $(CFLAGS-linuxthreads)
@@ -69,8 +68,8 @@ libpthread_libc_OBJ := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_
libc-static-y += $(libpthread_OUT)/libc_pthread_init.o
libc-shared-y += $(libpthread_libc_OBJ:.o=.oS)
-libpthread-static-y += $(patsubst %.c,$(libpthread_OUT)/%.o,$(libpthread_SPEC_SRC))
-libpthread-shared-y += $(patsubst %.c,$(libpthread_OUT)/%.oS,$(libpthread_SPEC_SRC))
+libpthread-static-y += $(patsubst %,$(libpthread_OUT)/%.o,$(libpthread_static_SRC))
+libpthread-shared-y += $(patsubst %,$(libpthread_OUT)/%.oS,$(libpthread_shared_SRC))
ifeq ($(DOPIC),y)
libpthread-a-y += $(libpthread_OBJ:.o=.os) $(libpthread-static-y:.o=.os)
@@ -79,17 +78,19 @@ libpthread-a-y += $(libpthread_OBJ) $(libpthread-static-y)
endif
libpthread-so-y += $(libpthread_OBJ:.o=.os) $(libpthread-shared-y)
-libpthread-multi-y += $(libpthread_SRC)
-libpthread-nomulti-y += $(patsubst %.c,$(libpthread_OUT)/%.o,$(libpthread_NO_MULTI))
-
lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
objclean-y += libpthread_clean
headers-$(UCLIBC_HAS_THREADS) += linuxthreads_headers
headers_clean-y += linuxthreads_headers_clean
+ifeq ($(DOMULTI),n)
$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc)
$(call link.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
+else
+$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread.oS $(libc)
+ $(call linkm.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
+endif
$(libpthread_OUT)/libpthread_so.a: $(libpthread-so-y)
$(Q)$(RM) $@
@@ -100,6 +101,15 @@ else
endif
$(do_ar)
+$(libpthread_OUT)/libpthread.oS: $(libpthread_SRC) $(patsubst %,$(libpthread_DIR)/%.c,$(libpthread_shared_SRC))
+ $(Q)$(RM) $@
+ $(compile-m)
+ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
+ $(do_t_strip:-x=-X --strip-debug)
+else
+ $(do_t_strip)
+endif
+
$(top_builddir)lib/libpthread.a: $(libpthread-a-y)
$(Q)$(INSTALL) -d $(dir $@)
$(Q)$(RM) $@
@@ -121,4 +131,4 @@ linuxthreads_headers_clean:
$(top_builddir)include/bits/pthreadtypes.h
libpthread_clean:
- $(RM) $(libpthread_OUT)/{,*/,*/*/,*/*/*/,*/*/*/*/}*.{o,os,a}
+ $(RM) $(libpthread_OUT)/{,*/,*/*/,*/*/*/,*/*/*/*/}*.{o,os,oS,a}
diff --git a/libpthread/linuxthreads/errno.c b/libpthread/linuxthreads/errno.c
index 1856f7347..03c23f867 100644
--- a/libpthread/linuxthreads/errno.c
+++ b/libpthread/linuxthreads/errno.c
@@ -36,6 +36,7 @@ __h_errno_location (void)
return THREAD_GETMEM (self, p_h_errnop);
}
+#if 0
/* Return thread specific resolver state. */
struct __res_state *
__res_state (void)
@@ -44,3 +45,4 @@ __res_state (void)
return THREAD_GETMEM (self, p_resp);
}
#endif
+#endif
diff --git a/libpthread/linuxthreads/forward.c b/libpthread/linuxthreads/forward.c
index ba83627a8..bec2297be 100644
--- a/libpthread/linuxthreads/forward.c
+++ b/libpthread/linuxthreads/forward.c
@@ -116,16 +116,16 @@ FORWARD (pthread_mutex_destroy, (pthread_mutex_t *mutex), (mutex), 0)
FORWARD (pthread_mutex_init,
(pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr),
(mutex, mutexattr), 0)
-hidden_strong_alias(pthread_mutex_init, __pthread_mutex_init)
+strong_alias(pthread_mutex_init, __pthread_mutex_init)
FORWARD (pthread_mutex_lock, (pthread_mutex_t *mutex), (mutex), 0)
-hidden_strong_alias(pthread_mutex_lock, __pthread_mutex_lock)
+strong_alias(pthread_mutex_lock, __pthread_mutex_lock)
FORWARD (pthread_mutex_trylock, (pthread_mutex_t *mutex), (mutex), 0)
-hidden_strong_alias(pthread_mutex_trylock, __pthread_mutex_trylock)
+strong_alias(pthread_mutex_trylock, __pthread_mutex_trylock)
FORWARD (pthread_mutex_unlock, (pthread_mutex_t *mutex), (mutex), 0)
-hidden_strong_alias(pthread_mutex_unlock, __pthread_mutex_unlock)
+strong_alias(pthread_mutex_unlock, __pthread_mutex_unlock)
FORWARD2 (pthread_self, pthread_t, (void), (), return 0)
diff --git a/libpthread/linuxthreads/internals.h b/libpthread/linuxthreads/internals.h
index b2625c761..0f797b353 100644
--- a/libpthread/linuxthreads/internals.h
+++ b/libpthread/linuxthreads/internals.h
@@ -372,7 +372,7 @@ extern pthread_t __pthread_self (void);
extern pthread_descr __pthread_thread_self (void);
extern pthread_descr __pthread_self_stack (void) attribute_hidden;
extern int __pthread_equal (pthread_t thread1, pthread_t thread2);
-extern void __pthread_exit (void *retval);
+extern void __pthread_exit (void *retval) attribute_noreturn;
extern int __pthread_getschedparam (pthread_t thread, int *policy,
struct sched_param *param);
extern int __pthread_setschedparam (pthread_t thread, int policy,
@@ -382,11 +382,11 @@ extern int __pthread_setcanceltype (int type, int * oldtype);
extern void __pthread_restart_old(pthread_descr th);
extern void __pthread_suspend_old(pthread_descr self);
-extern int __pthread_timedsuspend_old(pthread_descr self, const struct timespec *abs);
+extern int __pthread_timedsuspend_old(pthread_descr self, const struct timespec *abstime);
extern void __pthread_restart_new(pthread_descr th);
extern void __pthread_suspend_new(pthread_descr self);
-extern int __pthread_timedsuspend_new(pthread_descr self, const struct timespec *abs);
+extern int __pthread_timedsuspend_new(pthread_descr self, const struct timespec *abstime);
extern void __pthread_wait_for_restart_signal(pthread_descr self);
@@ -528,7 +528,9 @@ weak_extern (__pthread_thread_self)
# define __manager_thread __pthread_manager_threadp
#endif
-extern inline __attribute__((always_inline)) pthread_descr
+extern __always_inline pthread_descr
+check_thread_self (void);
+extern __always_inline pthread_descr
check_thread_self (void)
{
pthread_descr self = thread_self ();
diff --git a/libpthread/linuxthreads/ptcleanup.c b/libpthread/linuxthreads/ptcleanup.c
index eda823a75..fa44ea142 100644
--- a/libpthread/linuxthreads/ptcleanup.c
+++ b/libpthread/linuxthreads/ptcleanup.c
@@ -20,7 +20,6 @@
#include <setjmp.h>
#include "pthread.h"
#include "internals.h"
-#include <sysdep.h>
#ifndef NO_PTR_DEMANGLE
#include <jmpbuf-unwind.h>
#define __JMPBUF_UNWINDS(a,b,c) _JMPBUF_UNWINDS(a,b,c)
diff --git a/libpthread/linuxthreads/pthread.c b/libpthread/linuxthreads/pthread.c
index 21656fe64..202dbc7b8 100644
--- a/libpthread/linuxthreads/pthread.c
+++ b/libpthread/linuxthreads/pthread.c
@@ -40,8 +40,7 @@
#endif
/* mods for uClibc: __libc_sigaction is not in any standard headers */
-extern int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact);
-extern int __cxa_atexit (void (*func) (void *), void *arg, void *d);
+extern __typeof(sigaction) __libc_sigaction;
#if !(USE_TLS && HAVE___THREAD)
/* These variables are used by the setup code. */
diff --git a/libpthread/linuxthreads/pthread_setegid.c b/libpthread/linuxthreads/pthread_setegid.c
index 9e16828fa..e357bb9ef 100644
--- a/libpthread/linuxthreads/pthread_setegid.c
+++ b/libpthread/linuxthreads/pthread_setegid.c
@@ -20,6 +20,7 @@
#include <unistd.h>
+int pthread_setegid_np (gid_t gid);
int
pthread_setegid_np (gid_t gid)
{
diff --git a/libpthread/linuxthreads/pthread_seteuid.c b/libpthread/linuxthreads/pthread_seteuid.c
index 9d29d8111..6a1464c58 100644
--- a/libpthread/linuxthreads/pthread_seteuid.c
+++ b/libpthread/linuxthreads/pthread_seteuid.c
@@ -20,6 +20,7 @@
#include <unistd.h>
+int pthread_seteuid_np (uid_t uid);
int
pthread_seteuid_np (uid_t uid)
{
diff --git a/libpthread/linuxthreads/pthread_setgid.c b/libpthread/linuxthreads/pthread_setgid.c
index db37dd146..31b5a595b 100644
--- a/libpthread/linuxthreads/pthread_setgid.c
+++ b/libpthread/linuxthreads/pthread_setgid.c
@@ -20,6 +20,7 @@
#include <unistd.h>
+int pthread_setgid_np (gid_t gid);
int
pthread_setgid_np (gid_t gid)
{
diff --git a/libpthread/linuxthreads/pthread_setregid.c b/libpthread/linuxthreads/pthread_setregid.c
index bd75154c5..8964eb774 100644
--- a/libpthread/linuxthreads/pthread_setregid.c
+++ b/libpthread/linuxthreads/pthread_setregid.c
@@ -20,6 +20,7 @@
#include <unistd.h>
+int pthread_setregid_np (gid_t rgid, gid_t egid);
int
pthread_setregid_np (gid_t rgid, gid_t egid)
{
diff --git a/libpthread/linuxthreads/pthread_setresgid.c b/libpthread/linuxthreads/pthread_setresgid.c
index b5702804e..a330afcdb 100644
--- a/libpthread/linuxthreads/pthread_setresgid.c
+++ b/libpthread/linuxthreads/pthread_setresgid.c
@@ -20,6 +20,7 @@
#include <unistd.h>
+int pthread_setresgid_np (gid_t rgid, gid_t egid, gid_t sgid);
int
pthread_setresgid_np (gid_t rgid, gid_t egid, gid_t sgid)
{
diff --git a/libpthread/linuxthreads/pthread_setresuid.c b/libpthread/linuxthreads/pthread_setresuid.c
index ceb724dea..0fa28954d 100644
--- a/libpthread/linuxthreads/pthread_setresuid.c
+++ b/libpthread/linuxthreads/pthread_setresuid.c
@@ -20,6 +20,7 @@
#include <unistd.h>
+int pthread_setresuid_np (uid_t ruid, uid_t euid, uid_t suid);
int
pthread_setresuid_np (uid_t ruid, uid_t euid, uid_t suid)
{
diff --git a/libpthread/linuxthreads/pthread_setreuid.c b/libpthread/linuxthreads/pthread_setreuid.c
index ae8933ece..78738e3cd 100644
--- a/libpthread/linuxthreads/pthread_setreuid.c
+++ b/libpthread/linuxthreads/pthread_setreuid.c
@@ -20,6 +20,7 @@
#include <unistd.h>
+int pthread_setreuid_np (uid_t ruid, uid_t euid);
int
pthread_setreuid_np (uid_t ruid, uid_t euid)
{
diff --git a/libpthread/linuxthreads/pthread_setuid.c b/libpthread/linuxthreads/pthread_setuid.c
index f82ccc1a2..107001e26 100644
--- a/libpthread/linuxthreads/pthread_setuid.c
+++ b/libpthread/linuxthreads/pthread_setuid.c
@@ -20,6 +20,7 @@
#include <unistd.h>
+int pthread_setuid_np (uid_t uid);
int
pthread_setuid_np (uid_t uid)
{
diff --git a/libpthread/linuxthreads/signals.c b/libpthread/linuxthreads/signals.c
index 2a14c8c0d..b282d3ecc 100644
--- a/libpthread/linuxthreads/signals.c
+++ b/libpthread/linuxthreads/signals.c
@@ -22,7 +22,7 @@
#include <ucontext.h>
/* mods for uClibc: __libc_sigaction is not in any standard headers */
-extern int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact);
+extern __typeof(sigaction) __libc_sigaction;
int pthread_sigmask(int how, const sigset_t * newmask, sigset_t * oldmask)
{
diff --git a/libpthread/linuxthreads/sysdeps/i386/pt-machine.h b/libpthread/linuxthreads/sysdeps/i386/pt-machine.h
index 8c3698dc0..8483d4ef6 100644
--- a/libpthread/linuxthreads/sysdeps/i386/pt-machine.h
+++ b/libpthread/linuxthreads/sysdeps/i386/pt-machine.h
@@ -77,6 +77,7 @@ __compare_and_swap (long int *p, long int oldval, long int newval)
}
+PT_EI int get_eflags (void);
PT_EI int
get_eflags (void)
{
@@ -86,6 +87,7 @@ get_eflags (void)
}
+PT_EI void set_eflags (int newflags);
PT_EI void
set_eflags (int newflags)
{
@@ -93,6 +95,7 @@ set_eflags (int newflags)
}
+PT_EI int compare_and_swap_is_available (void);
PT_EI int
compare_and_swap_is_available (void)
{
diff --git a/libpthread/linuxthreads/sysdeps/i386/tls.h b/libpthread/linuxthreads/sysdeps/i386/tls.h
index c5cb07ba3..f230a33ba 100644
--- a/libpthread/linuxthreads/sysdeps/i386/tls.h
+++ b/libpthread/linuxthreads/sysdeps/i386/tls.h
@@ -117,7 +117,7 @@ typedef struct
# define TLS_LOAD_EBX
# endif
-# if !defined IS_IN_linuxthreads && !defined DO_MODIFY_LDT
+# if !defined IS_IN_libpthread && !defined DO_MODIFY_LDT
# include "useldt.h" /* For the structure. */
# endif
# if __ASSUME_LDT_WORKS > 0
diff --git a/libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h b/libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h
index 803466de1..51162b95e 100644
--- a/libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h
+++ b/libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h
@@ -5,7 +5,7 @@
#include <sys/cdefs.h>
#include <bits/uClibc_page.h>
-#if IS_IN_linuxthreads
+#ifdef IS_IN_libpthread
#include "kernel-features.h"
#ifndef _GNU_SOURCE
@@ -39,7 +39,7 @@
extern void *__libc_stack_end;
extern int __cxa_atexit (void (*func) (void *), void *arg, void *d);
-#endif /* IS_IN_linuxthreads */
+#endif /* IS_IN_libpthread */
/* Use a funky version in a probably vein attempt at preventing gdb
* from dlopen()'ing glibc's libthread_db library... */
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h
index d2a16d8ce..85477eb48 100644
--- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h
+++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h
@@ -19,7 +19,6 @@
#include <list.h>
#include <bits/libc-lock.h>
-#include <sysdep.h>
struct fork_block
{
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
index c8be0fdd3..a5dbeff1e 100644
--- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
+++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
@@ -17,7 +17,6 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <sysdep.h>
#include <tls.h>
#include <pt-machine.h>
#ifndef __ASSEMBLER__
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c
index 23731b3ee..7c9fe36e2 100644
--- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c
+++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c
@@ -21,7 +21,6 @@
#include <signal.h>
#include <unistd.h>
-#include <sysdep.h>
#include <sys/syscall.h>
#include <linuxthreads/internals.h>