[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] Provide GLIBC_2_0 versions of pthread_create and pthread_attr_init



pthread_create and pthread_attr_init have, in LinuxThreads, a
GLIBC_2_0 version that allocates a smaller structure that was used in
glibc 2.0; they are different from the GLIBC_2_1 ones in order to save
space.

In NPTL, the layout of pthread_attr_t is different, and the
LinuxThreads behavior no longer makes sense.
Thus this patch provides the GLIBC_2_0 versions as aliases to the
GLIBC_2_1 ones.

Note that the layout change means that any program that directly
modifies pthread_attr_t will not work with NPTL: fixing this requires
switching back to the less efficient LinuxThreads layout, so I don't
think that this should be done unless some really important program
relies on this.

This makes Apache2 and Evolution Summary work!


--- nptl/pthread_attr_init.c~	2002-09-19 11:57:29.000000000 +0200
+++ nptl/pthread_attr_init.c	2002-11-01 11:27:03.000000000 +0100
@@ -65,13 +65,8 @@ versioned_symbol (libpthread, __pthread_
 
 
 #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
-int
-__pthread_attr_init_2_0 (attr)
-     pthread_attr_t *attr;
-{
-  return ENOSYS;
-}
+strong_alias(__pthread_attr_init_2_1, __pthread_attr_init_2_0);
 compat_symbol (libpthread, __pthread_attr_init_2_0, pthread_attr_init,
 	       GLIBC_2_0);
 #endif
--- nptl/pthread_create.c~	2002-11-01 03:42:43.000000000 +0100
+++ nptl/pthread_create.c	2002-11-01 11:26:45.000000000 +0100
@@ -380,15 +380,7 @@ versioned_symbol (libpthread, __pthread_
 
 
 #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
-int
-__pthread_create_2_0 (newthread, attr, start_routine, arg)
-     pthread_t *newthread;
-     const pthread_attr_t *attr;
-     void *(*start_routine) (void *);
-     void *arg;
-{
-  return ENOSYS;
-}
+strong_alias(__pthread_create_2_1, __pthread_create_2_0);
 compat_symbol (libpthread, __pthread_create_2_0, pthread_create,
 	       GLIBC_2_0);
 #endif

Attachment: pgp00021.pgp
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]