about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog15
-rw-r--r--nptl/forward.c15
-rw-r--r--nptl/init.c3
-rw-r--r--nptl/pt-system.c1
-rw-r--r--nptl/pthreadP.h3
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h8
6 files changed, 37 insertions, 8 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 57f6d493ea..0b7bbd4c57 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,18 @@
+2002-12-17  Jakub Jelinek  <jakub@redhat.com>
+
+	* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
+	Define meaningfully for assembler as well.
+	* pthreadP.h (struct pthread_functions): Remove
+	ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
+	and ptr_pthread_attr_init_2_1 fields.
+	* init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
+	and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
+	* forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
+	(FORWARD3): Define using FORWARD4.
+	(pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
+	versions.
+	* pt-system.c: Remove duplicate stdlib.h include.
+
 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
 
 	* sem_init.c: Define sem_init@GLIBC_2.0.
diff --git a/nptl/forward.c b/nptl/forward.c
index e178136737..e68b9b198e 100644
--- a/nptl/forward.c
+++ b/nptl/forward.c
@@ -30,7 +30,7 @@ struct pthread_functions __libc_pthread_functions attribute_hidden;
 
 
 #if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_3_2)
-# define FORWARD3(name, rettype, decl, params, defaction, version) \
+# define FORWARD4(name, export, rettype, decl, params, defaction, version) \
 rettype									      \
 __noexport_##name decl							      \
 {									      \
@@ -39,7 +39,10 @@ __noexport_##name decl							      \
 									      \
   return __libc_pthread_functions.ptr_##name params;			      \
 }									      \
-compat_symbol (libc, __noexport_##name, name, version)
+compat_symbol (libc, __noexport_##name, export, version)
+
+# define FORWARD3(name, rettype, decl, params, defaction, version) \
+  FORWARD4 (name, name, rettype, decl, params, defaction, version)
 
 # define FORWARD2(name, decl, params, defretval, version) \
   FORWARD3 (name, int, decl, params, return defretval, version)
@@ -50,7 +53,13 @@ compat_symbol (libc, __noexport_##name, name, version)
 
 FORWARD (pthread_attr_destroy, (pthread_attr_t *attr), (attr), 0);
 
-FORWARD2 (pthread_attr_init, (pthread_attr_t *attr), (attr), 0, GLIBC_2_1);
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_1)
+FORWARD4 (pthread_attr_init_2_0, pthread_attr_init, int,
+	  (pthread_attr_t *attr), (attr), 0, GLIBC_2_0);
+#endif
+
+FORWARD4 (pthread_attr_init_2_1, pthread_attr_init, int,
+	  (pthread_attr_t *attr), (attr), 0, GLIBC_2_1);
 
 FORWARD (pthread_attr_getdetachstate,
 	 (const pthread_attr_t *attr, int *detachstate), (attr, detachstate),
diff --git a/nptl/init.c b/nptl/init.c
index f0be750261..39cf41ee9b 100644
--- a/nptl/init.c
+++ b/nptl/init.c
@@ -56,7 +56,8 @@ extern void __libc_setup_tls (size_t tcbsize, size_t tcbalign);
 static struct pthread_functions pthread_functions =
   {
     .ptr_pthread_attr_destroy = __pthread_attr_destroy,
-    .ptr_pthread_attr_init = __pthread_attr_init_2_1,
+    .ptr_pthread_attr_init_2_0 = __pthread_attr_init_2_0,
+    .ptr_pthread_attr_init_2_1 = __pthread_attr_init_2_1,
     .ptr_pthread_attr_getdetachstate = __pthread_attr_getdetachstate,
     .ptr_pthread_attr_setdetachstate = __pthread_attr_setdetachstate,
     .ptr_pthread_attr_getinheritsched = __pthread_attr_getinheritsched,
diff --git a/nptl/pt-system.c b/nptl/pt-system.c
index d02f451893..e98f04c413 100644
--- a/nptl/pt-system.c
+++ b/nptl/pt-system.c
@@ -20,7 +20,6 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <sysdep.h>
-#include <stdlib.h>
 #include "pthreadP.h"
 
 
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index c666387008..482c535434 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -72,7 +72,8 @@ extern int __pthread_debug attribute_hidden;
 struct pthread_functions
 {
   int (*ptr_pthread_attr_destroy) (pthread_attr_t *);
-  int (*ptr_pthread_attr_init) (pthread_attr_t *);
+  int (*ptr_pthread_attr_init_2_0) (pthread_attr_t *);
+  int (*ptr_pthread_attr_init_2_1) (pthread_attr_t *);
   int (*ptr_pthread_attr_getdetachstate) (const pthread_attr_t *, int *);
   int (*ptr_pthread_attr_setdetachstate) (pthread_attr_t *, int);
   int (*ptr_pthread_attr_getinheritsched) (const pthread_attr_t *, int *);
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
index 39bdfbea1d..82b9ec8b0c 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
+++ b/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
@@ -76,11 +76,15 @@
 # define POPCARGS_4	POPCARGS_2
 # define POPCARGS_5	POPCARGS_2
 
-# define SINGLE_THREAD_P \
+# ifndef ASSEMBLER
+#  define SINGLE_THREAD_P \
   __builtin_expect (THREAD_GETMEM (THREAD_SELF,				      \
 				   header.data.multiple_threads) == 0, 1)
+# else
+#  define SINGLE_THREAD_P cmpl $0, %gs:MULTIPLE_THREADS_OFFSET
+# endif
 
-#else
+#elif !defined ASSEMBLER
 
 /* This code should never be used but we define it anyhow.  */
 # define SINGLE_THREAD_P (1)