summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libpthread/nptl/ChangeLog7
-rw-r--r--libpthread/nptl/descr.h8
-rw-r--r--libpthread/nptl/forward.c1
-rw-r--r--libpthread/nptl/init.c1
-rw-r--r--libpthread/nptl/pthread_attr_destroy.c6
-rw-r--r--libpthread/nptl/pthread_attr_init.c37
-rw-r--r--libpthread/nptl/pthread_attr_setstack.c37
-rw-r--r--libpthread/nptl/pthread_attr_setstacksize.c30
-rw-r--r--libpthread/nptl/pthread_cond_destroy.c1
-rw-r--r--libpthread/nptl/pthread_cond_init.c1
-rw-r--r--libpthread/nptl/pthread_create.c3
-rw-r--r--libpthread/nptl/sem_destroy.c5
-rw-r--r--libpthread/nptl/sem_getvalue.c5
-rw-r--r--libpthread/nptl/sem_init.c5
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/fork.h1
15 files changed, 141 insertions, 7 deletions
diff --git a/libpthread/nptl/ChangeLog b/libpthread/nptl/ChangeLog
index b5ec0e44d..497b33d8a 100644
--- a/libpthread/nptl/ChangeLog
+++ b/libpthread/nptl/ChangeLog
@@ -1,3 +1,10 @@
+2005-05-29 Richard Henderson <rth@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@redhat.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
diff --git a/libpthread/nptl/descr.h b/libpthread/nptl/descr.h
index cf071dd81..454bb2a54 100644
--- a/libpthread/nptl/descr.h
+++ b/libpthread/nptl/descr.h
@@ -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
diff --git a/libpthread/nptl/forward.c b/libpthread/nptl/forward.c
index 96e6e5c45..e5f93d475 100644
--- a/libpthread/nptl/forward.c
+++ b/libpthread/nptl/forward.c
@@ -22,6 +22,7 @@
#include <signal.h>
#include <stdlib.h>
+#include <shlib-compat.h>
#include <atomic.h>
#include <sysdep.h>
diff --git a/libpthread/nptl/init.c b/libpthread/nptl/init.c
index a5383625f..4c0a69d17 100644
--- a/libpthread/nptl/init.c
+++ b/libpthread/nptl/init.c
@@ -30,6 +30,7 @@
#include <tls.h>
#include <fork.h>
#include <version.h>
+#include <shlib-compat.h>
#include <smp.h>
#include <lowlevellock.h>
diff --git a/libpthread/nptl/pthread_attr_destroy.c b/libpthread/nptl/pthread_attr_destroy.c
index a30df0c45..b8d9a20d3 100644
--- a/libpthread/nptl/pthread_attr_destroy.c
+++ b/libpthread/nptl/pthread_attr_destroy.c
@@ -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 @@ __pthread_attr_destroy (attr)
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);
diff --git a/libpthread/nptl/pthread_attr_init.c b/libpthread/nptl/pthread_attr_init.c
index 625ccd442..c84b33f31 100644
--- a/libpthread/nptl/pthread_attr_init.c
+++ b/libpthread/nptl/pthread_attr_init.c
@@ -23,6 +23,8 @@
#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 @@ __pthread_attr_init_2_1 (attr)
}
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
diff --git a/libpthread/nptl/pthread_attr_setstack.c b/libpthread/nptl/pthread_attr_setstack.c
index 88a98d8d2..622e4a225 100644
--- a/libpthread/nptl/pthread_attr_setstack.c
+++ b/libpthread/nptl/pthread_attr_setstack.c
@@ -49,4 +49,41 @@ __pthread_attr_setstack (attr, stackaddr, stacksize)
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
diff --git a/libpthread/nptl/pthread_attr_setstacksize.c b/libpthread/nptl/pthread_attr_setstacksize.c
index 7d847ef08..f84a9f68e 100644
--- a/libpthread/nptl/pthread_attr_setstacksize.c
+++ b/libpthread/nptl/pthread_attr_setstacksize.c
@@ -42,4 +42,34 @@ __pthread_attr_setstacksize (attr, stacksize)
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
diff --git a/libpthread/nptl/pthread_cond_destroy.c b/libpthread/nptl/pthread_cond_destroy.c
index d2f8e6202..0208d18ce 100644
--- a/libpthread/nptl/pthread_cond_destroy.c
+++ b/libpthread/nptl/pthread_cond_destroy.c
@@ -18,6 +18,7 @@
02111-1307 USA. */
#include <errno.h>
+#include <shlib-compat.h>
#include "pthreadP.h"
diff --git a/libpthread/nptl/pthread_cond_init.c b/libpthread/nptl/pthread_cond_init.c
index fd5c84c34..5e2e6704a 100644
--- a/libpthread/nptl/pthread_cond_init.c
+++ b/libpthread/nptl/pthread_cond_init.c
@@ -17,6 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <shlib-compat.h>
#include "pthreadP.h"
diff --git a/libpthread/nptl/pthread_create.c b/libpthread/nptl/pthread_create.c
index 3572fcf88..18f1c034c 100644
--- a/libpthread/nptl/pthread_create.c
+++ b/libpthread/nptl/pthread_create.c
@@ -22,11 +22,14 @@
#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);
diff --git a/libpthread/nptl/sem_destroy.c b/libpthread/nptl/sem_destroy.c
index 1472a945c..1c823dc51 100644
--- a/libpthread/nptl/sem_destroy.c
+++ b/libpthread/nptl/sem_destroy.c
@@ -18,6 +18,7 @@
02111-1307 USA. */
#include <semaphore.h>
+#include <shlib-compat.h>
#include "semaphoreP.h"
@@ -31,3 +32,7 @@ __new_sem_destroy (sem)
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
diff --git a/libpthread/nptl/sem_getvalue.c b/libpthread/nptl/sem_getvalue.c
index 4be736da0..6bc7ea82b 100644
--- a/libpthread/nptl/sem_getvalue.c
+++ b/libpthread/nptl/sem_getvalue.c
@@ -18,6 +18,7 @@
02111-1307 USA. */
#include <semaphore.h>
+#include <shlib-compat.h>
#include "semaphoreP.h"
@@ -35,3 +36,7 @@ __new_sem_getvalue (sem, sval)
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
diff --git a/libpthread/nptl/sem_init.c b/libpthread/nptl/sem_init.c
index 6f371589a..8709911ac 100644
--- a/libpthread/nptl/sem_init.c
+++ b/libpthread/nptl/sem_init.c
@@ -20,6 +20,7 @@
#include <errno.h>
#include <semaphore.h>
#include <lowlevellock.h>
+#include <shlib-compat.h>
#include "semaphoreP.h"
@@ -48,3 +49,7 @@ __new_sem_init (sem, pshared, value)
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
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/fork.h b/libpthread/nptl/sysdeps/unix/sysv/linux/fork.h
index bcdf6217c..d093ccc90 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/fork.h
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/fork.h
@@ -54,3 +54,4 @@ extern int __register_atfork (void (*__prepare) (void),
void (*__parent) (void),
void (*__child) (void),
void *dso_handle);
+libc_hidden_proto (__register_atfork)