[uClibc-cvs] svn commit: branches/uClibc-nptl/libpthread/nptl: sysdeps/unix/sysv/linux
sjhill at uclibc.org
sjhill at uclibc.org
Fri Jun 3 02:51:16 UTC 2005
Author: sjhill
Date: 2005-06-02 20:51:14 -0600 (Thu, 02 Jun 2005)
New Revision: 10458
Log:
Sync up with latest NPTL code from glibc and add minor
#ifdef __UCLIBC__ directives.
Modified:
branches/uClibc-nptl/libpthread/nptl/ChangeLog
branches/uClibc-nptl/libpthread/nptl/descr.h
branches/uClibc-nptl/libpthread/nptl/forward.c
branches/uClibc-nptl/libpthread/nptl/init.c
branches/uClibc-nptl/libpthread/nptl/pthread_attr_destroy.c
branches/uClibc-nptl/libpthread/nptl/pthread_attr_init.c
branches/uClibc-nptl/libpthread/nptl/pthread_attr_setstack.c
branches/uClibc-nptl/libpthread/nptl/pthread_attr_setstacksize.c
branches/uClibc-nptl/libpthread/nptl/pthread_cond_destroy.c
branches/uClibc-nptl/libpthread/nptl/pthread_cond_init.c
branches/uClibc-nptl/libpthread/nptl/pthread_create.c
branches/uClibc-nptl/libpthread/nptl/sem_destroy.c
branches/uClibc-nptl/libpthread/nptl/sem_getvalue.c
branches/uClibc-nptl/libpthread/nptl/sem_init.c
branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/fork.h
Changeset:
Modified: branches/uClibc-nptl/libpthread/nptl/ChangeLog
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/ChangeLog 2005-06-03 02:43:46 UTC (rev 10457)
+++ branches/uClibc-nptl/libpthread/nptl/ChangeLog 2005-06-03 02:51:14 UTC (rev 10458)
@@ -1,3 +1,10 @@
+2005-05-29 Richard Henderson <rth at redhat.com>
+
+ * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
+ (tf_write, tf_writev): Use it.
+ (do_test): Use socketpair instead of pipe. Set SO_SNDBUF to
+ the system minimum.
+
2005-05-23 Jakub Jelinek <jakub at redhat.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
Modified: branches/uClibc-nptl/libpthread/nptl/descr.h
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/descr.h 2005-06-03 02:43:46 UTC (rev 10457)
+++ branches/uClibc-nptl/libpthread/nptl/descr.h 2005-06-03 02:51:14 UTC (rev 10458)
@@ -25,17 +25,11 @@
#include <setjmp.h>
#include <stdbool.h>
#include <sys/types.h>
+#include <hp-timing.h>
#include <list.h>
#include <lowlevellock.h>
#include <pthreaddef.h>
-#if 0
-/*
- * MIPS NPTL - defines a total of two symbols used by the glibc
- * dynamic loader. Hopefully we will not need it for
- * uClibc.
- */
#include <dl-sysdep.h>
-#endif
#include "../nptl_db/thread_db.h"
#include <tls.h>
#ifdef HAVE_FORCED_UNWIND
Modified: branches/uClibc-nptl/libpthread/nptl/forward.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/forward.c 2005-06-03 02:43:46 UTC (rev 10457)
+++ branches/uClibc-nptl/libpthread/nptl/forward.c 2005-06-03 02:51:14 UTC (rev 10458)
@@ -22,6 +22,7 @@
#include <signal.h>
#include <stdlib.h>
+#include <shlib-compat.h>
#include <atomic.h>
#include <sysdep.h>
Modified: branches/uClibc-nptl/libpthread/nptl/init.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/init.c 2005-06-03 02:43:46 UTC (rev 10457)
+++ branches/uClibc-nptl/libpthread/nptl/init.c 2005-06-03 02:51:14 UTC (rev 10458)
@@ -30,6 +30,7 @@
#include <tls.h>
#include <fork.h>
#include <version.h>
+#include <shlib-compat.h>
#include <smp.h>
#include <lowlevellock.h>
Modified: branches/uClibc-nptl/libpthread/nptl/pthread_attr_destroy.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/pthread_attr_destroy.c 2005-06-03 02:43:46 UTC (rev 10457)
+++ branches/uClibc-nptl/libpthread/nptl/pthread_attr_destroy.c 2005-06-03 02:51:14 UTC (rev 10458)
@@ -22,6 +22,7 @@
#include <string.h>
#include <unistd.h>
#include "pthreadP.h"
+#include <shlib-compat.h>
int
__pthread_attr_destroy (attr)
@@ -32,6 +33,11 @@
assert (sizeof (*attr) >= sizeof (struct pthread_attr));
iattr = (struct pthread_attr *) attr;
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
+ /* In old struct pthread_attr, neither next nor cpuset are
+ present. */
+ if (__builtin_expect ((iattr->flags & ATTR_FLAG_OLDATTR), 0) == 0)
+#endif
/* The affinity CPU set might be allocated dynamically. */
free (iattr->cpuset);
Modified: branches/uClibc-nptl/libpthread/nptl/pthread_attr_init.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/pthread_attr_init.c 2005-06-03 02:43:46 UTC (rev 10457)
+++ branches/uClibc-nptl/libpthread/nptl/pthread_attr_init.c 2005-06-03 02:51:14 UTC (rev 10458)
@@ -23,7 +23,9 @@
#include <unistd.h>
#include "pthreadP.h"
+#include <shlib-compat.h>
+
struct pthread_attr *__attr_list;
lll_lock_t __attr_list_lock = LLL_LOCK_INITIALIZER;
@@ -49,3 +51,38 @@
}
versioned_symbol (libpthread, __pthread_attr_init_2_1, pthread_attr_init,
GLIBC_2_1);
+
+
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
+int
+__pthread_attr_init_2_0 (attr)
+ pthread_attr_t *attr;
+{
+ /* This code is specific to the old LinuxThread code which has a too
+ small pthread_attr_t definition. The struct looked like
+ this: */
+ struct old_attr
+ {
+ int detachstate;
+ int schedpolicy;
+ struct sched_param schedparam;
+ int inheritsched;
+ int scope;
+ };
+ struct pthread_attr *iattr;
+
+ /* Many elements are initialized to zero so let us do it all at
+ once. This also takes care of clearing the bytes which are not
+ internally used. */
+ memset (attr, '\0', sizeof (struct old_attr));
+
+ iattr = (struct pthread_attr *) attr;
+ iattr->flags |= ATTR_FLAG_OLDATTR;
+
+ /* We cannot enqueue the attribute because that member is not in the
+ old attribute structure. */
+ return 0;
+}
+compat_symbol (libpthread, __pthread_attr_init_2_0, pthread_attr_init,
+ GLIBC_2_0);
+#endif
Modified: branches/uClibc-nptl/libpthread/nptl/pthread_attr_setstack.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/pthread_attr_setstack.c 2005-06-03 02:43:46 UTC (rev 10457)
+++ branches/uClibc-nptl/libpthread/nptl/pthread_attr_setstack.c 2005-06-03 02:51:14 UTC (rev 10458)
@@ -49,4 +49,41 @@
return 0;
}
+#if PTHREAD_STACK_MIN == 16384
strong_alias (__pthread_attr_setstack, pthread_attr_setstack)
+#else
+# include <shlib-compat.h>
+versioned_symbol (libpthread, __pthread_attr_setstack, pthread_attr_setstack,
+ GLIBC_2_3_3);
+
+# if SHLIB_COMPAT(libpthread, GLIBC_2_2, GLIBC_2_3_3)
+
+int
+__old_pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr,
+ size_t stacksize)
+{
+ struct pthread_attr *iattr;
+
+ assert (sizeof (*attr) >= sizeof (struct pthread_attr));
+ iattr = (struct pthread_attr *) attr;
+
+ /* Catch invalid sizes. */
+ if (stacksize < 16384)
+ return EINVAL;
+
+# ifdef EXTRA_PARAM_CHECKS
+ EXTRA_PARAM_CHECKS;
+# endif
+
+ iattr->stacksize = stacksize;
+ iattr->stackaddr = (char *) stackaddr + stacksize;
+ iattr->flags |= ATTR_FLAG_STACKADDR;
+
+ return 0;
+}
+
+compat_symbol (libpthread, __old_pthread_attr_setstack, pthread_attr_setstack,
+ GLIBC_2_2);
+# endif
+
+#endif
Modified: branches/uClibc-nptl/libpthread/nptl/pthread_attr_setstacksize.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/pthread_attr_setstacksize.c 2005-06-03 02:43:46 UTC (rev 10457)
+++ branches/uClibc-nptl/libpthread/nptl/pthread_attr_setstacksize.c 2005-06-03 02:51:14 UTC (rev 10458)
@@ -42,4 +42,34 @@
return 0;
}
+#if PTHREAD_STACK_MIN == 16384
strong_alias (__pthread_attr_setstacksize, pthread_attr_setstacksize)
+#else
+# include <shlib-compat.h>
+versioned_symbol (libpthread, __pthread_attr_setstacksize,
+ pthread_attr_setstacksize, GLIBC_2_3_3);
+
+# if SHLIB_COMPAT(libpthread, GLIBC_2_1, GLIBC_2_3_3)
+
+int
+__old_pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize)
+{
+ struct pthread_attr *iattr;
+
+ assert (sizeof (*attr) >= sizeof (struct pthread_attr));
+ iattr = (struct pthread_attr *) attr;
+
+ /* Catch invalid sizes. */
+ if (stacksize < 16384)
+ return EINVAL;
+
+ iattr->stacksize = stacksize;
+
+ return 0;
+}
+
+compat_symbol (libpthread, __old_pthread_attr_setstacksize,
+ pthread_attr_setstacksize, GLIBC_2_1);
+# endif
+
+#endif
Modified: branches/uClibc-nptl/libpthread/nptl/pthread_cond_destroy.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/pthread_cond_destroy.c 2005-06-03 02:43:46 UTC (rev 10457)
+++ branches/uClibc-nptl/libpthread/nptl/pthread_cond_destroy.c 2005-06-03 02:51:14 UTC (rev 10458)
@@ -18,6 +18,7 @@
02111-1307 USA. */
#include <errno.h>
+#include <shlib-compat.h>
#include "pthreadP.h"
Modified: branches/uClibc-nptl/libpthread/nptl/pthread_cond_init.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/pthread_cond_init.c 2005-06-03 02:43:46 UTC (rev 10457)
+++ branches/uClibc-nptl/libpthread/nptl/pthread_cond_init.c 2005-06-03 02:51:14 UTC (rev 10458)
@@ -17,6 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <shlib-compat.h>
#include "pthreadP.h"
Modified: branches/uClibc-nptl/libpthread/nptl/pthread_create.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/pthread_create.c 2005-06-03 02:43:46 UTC (rev 10457)
+++ branches/uClibc-nptl/libpthread/nptl/pthread_create.c 2005-06-03 02:51:14 UTC (rev 10458)
@@ -22,12 +22,15 @@
#include <stdlib.h>
#include <string.h>
#include "pthreadP.h"
+#include <hp-timing.h>
#include <ldsodefs.h>
#include <atomic.h>
#include <libc-internal.h>
#include <resolv.h>
+#include <shlib-compat.h>
+
/* Local function to start thread and handle cleanup. */
static int start_thread (void *arg);
Modified: branches/uClibc-nptl/libpthread/nptl/sem_destroy.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sem_destroy.c 2005-06-03 02:43:46 UTC (rev 10457)
+++ branches/uClibc-nptl/libpthread/nptl/sem_destroy.c 2005-06-03 02:51:14 UTC (rev 10458)
@@ -18,6 +18,7 @@
02111-1307 USA. */
#include <semaphore.h>
+#include <shlib-compat.h>
#include "semaphoreP.h"
@@ -31,3 +32,7 @@
return 0;
}
versioned_symbol (libpthread, __new_sem_destroy, sem_destroy, GLIBC_2_1);
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
+strong_alias (__new_sem_destroy, __old_sem_destroy)
+compat_symbol (libpthread, __old_sem_destroy, sem_destroy, GLIBC_2_0);
+#endif
Modified: branches/uClibc-nptl/libpthread/nptl/sem_getvalue.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sem_getvalue.c 2005-06-03 02:43:46 UTC (rev 10457)
+++ branches/uClibc-nptl/libpthread/nptl/sem_getvalue.c 2005-06-03 02:51:14 UTC (rev 10458)
@@ -18,6 +18,7 @@
02111-1307 USA. */
#include <semaphore.h>
+#include <shlib-compat.h>
#include "semaphoreP.h"
@@ -35,3 +36,7 @@
return 0;
}
versioned_symbol (libpthread, __new_sem_getvalue, sem_getvalue, GLIBC_2_1);
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
+strong_alias (__new_sem_getvalue, __old_sem_getvalue)
+compat_symbol (libpthread, __old_sem_getvalue, sem_getvalue, GLIBC_2_0);
+#endif
Modified: branches/uClibc-nptl/libpthread/nptl/sem_init.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sem_init.c 2005-06-03 02:43:46 UTC (rev 10457)
+++ branches/uClibc-nptl/libpthread/nptl/sem_init.c 2005-06-03 02:51:14 UTC (rev 10458)
@@ -20,6 +20,7 @@
#include <errno.h>
#include <semaphore.h>
#include <lowlevellock.h>
+#include <shlib-compat.h>
#include "semaphoreP.h"
@@ -48,3 +49,7 @@
return 0;
}
versioned_symbol (libpthread, __new_sem_init, sem_init, GLIBC_2_1);
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
+strong_alias (__new_sem_init, __old_sem_init)
+compat_symbol (libpthread, __old_sem_init, sem_init, GLIBC_2_0);
+#endif
Modified: branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/fork.h
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/fork.h 2005-06-03 02:43:46 UTC (rev 10457)
+++ branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/fork.h 2005-06-03 02:51:14 UTC (rev 10458)
@@ -54,3 +54,4 @@
void (*__parent) (void),
void (*__child) (void),
void *dso_handle);
+libc_hidden_proto (__register_atfork)
More information about the uClibc-cvs
mailing list