summaryrefslogtreecommitdiffstats
path: root/libpthread/nptl/pthread_attr_init.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2005-06-03 02:51:14 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2005-06-03 02:51:14 +0000
commit5b9e501c32829682998ec9b5bfdd9417b99d1ad3 (patch)
tree1d1671382a93930180b7ec2a9104bba4baf9a71b /libpthread/nptl/pthread_attr_init.c
parent855c7fda61d9313052a0afdfe851a4b390da845c (diff)
downloaduClibc-alpine-5b9e501c32829682998ec9b5bfdd9417b99d1ad3.tar.bz2
uClibc-alpine-5b9e501c32829682998ec9b5bfdd9417b99d1ad3.tar.xz
Sync up with latest NPTL code from glibc and add minor
#ifdef __UCLIBC__ directives.
Diffstat (limited to 'libpthread/nptl/pthread_attr_init.c')
-rw-r--r--libpthread/nptl/pthread_attr_init.c37
1 files changed, 37 insertions, 0 deletions
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