diff options
Diffstat (limited to 'libpthread/nptl/pthread_attr_init.c')
-rw-r--r-- | libpthread/nptl/pthread_attr_init.c | 37 |
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 |