about summary refs log tree commit diff
path: root/nptl/pthread_attr_destroy.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/pthread_attr_destroy.c')
-rw-r--r--nptl/pthread_attr_destroy.c9
1 files changed, 8 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)
     {