aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
Diffstat (limited to 'nptl')
-rw-r--r--nptl/pthread_attr_destroy.c9
-rw-r--r--nptl/pthread_attr_init.c4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/internaltypes.h1
3 files changed, 13 insertions, 1 deletions
diff --git a/nptl/pthread_attr_destroy.c b/nptl/pthread_attr_destroy.c
index a04f5fe441..73cba1da01 100644
--- a/nptl/pthread_attr_destroy.c
+++ b/nptl/pthread_attr_destroy.c
@@ -22,7 +22,7 @@
#include <string.h>
#include <unistd.h>
#include "pthreadP.h"
-
+#include <shlib-compat.h>
int
__pthread_attr_destroy (attr)
@@ -33,6 +33,13 @@ __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))
+ return 0;
+#endif
+
/* Enqueue the attributes to the list of all known variables. */
if (DEBUGGING_P)
{
diff --git a/nptl/pthread_attr_init.c b/nptl/pthread_attr_init.c
index b202d46bd3..b1242d318f 100644
--- a/nptl/pthread_attr_init.c
+++ b/nptl/pthread_attr_init.c
@@ -80,12 +80,16 @@ __pthread_attr_init_2_0 (attr)
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;
diff --git a/nptl/sysdeps/unix/sysv/linux/internaltypes.h b/nptl/sysdeps/unix/sysv/linux/internaltypes.h
index e2f7b047f1..39afb32aac 100644
--- a/nptl/sysdeps/unix/sysv/linux/internaltypes.h
+++ b/nptl/sysdeps/unix/sysv/linux/internaltypes.h
@@ -47,6 +47,7 @@ struct pthread_attr
#define ATTR_FLAG_NOTINHERITSCHED 0x0002
#define ATTR_FLAG_SCOPEPROCESS 0x0004
#define ATTR_FLAG_STACKADDR 0x0008
+#define ATTR_FLAG_OLDATTR 0x0010
/* Mutex attribute data structure. */