about summary refs log tree commit diff
path: root/linuxthreads
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-03-22 08:01:35 +0000
committerUlrich Drepper <drepper@redhat.com>2000-03-22 08:01:35 +0000
commitef7dddd01c9b2c2e6e676c023b9b6ae63ae9e49d (patch)
tree6f95b7b9c141fb01f711138c8a2ea84a34c80d2d /linuxthreads
parent1ab1ea76bf65a1cf97dd734a75a08e1d79913b37 (diff)
downloadglibc-ef7dddd01c9b2c2e6e676c023b9b6ae63ae9e49d.tar.gz
glibc-ef7dddd01c9b2c2e6e676c023b9b6ae63ae9e49d.tar.xz
glibc-ef7dddd01c9b2c2e6e676c023b9b6ae63ae9e49d.zip
Update.
	* sysdeps/unix/sysv/linux/errlist.c: Likewise.
Diffstat (limited to 'linuxthreads')
-rw-r--r--linuxthreads/ChangeLog5
-rw-r--r--linuxthreads/attr.c9
-rw-r--r--linuxthreads/oldsemaphore.c10
-rw-r--r--linuxthreads/pthread.c2
-rw-r--r--linuxthreads/semaphore.c33
-rw-r--r--linuxthreads/weaks.c15
6 files changed, 35 insertions, 39 deletions
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 0c10a8ff5d..6d28f909c0 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,5 +1,10 @@
 2000-03-21  Ulrich Drepper  <drepper@redhat.com>
 
+	* attr.c: Use new macros from shlib-compat.h to define versions.
+	* oldsemaphore.c: Likewise.
+	* semaphore.c: Likewise.
+	* weaks.c: Likewise.
+
 	* pthread.c: Update for new SHLIB_COMPAT definition.
 
 	* manager.c (__pthread_manager): Unmask debug signal.
diff --git a/linuxthreads/attr.c b/linuxthreads/attr.c
index 2a70ebe674..992234aadf 100644
--- a/linuxthreads/attr.c
+++ b/linuxthreads/attr.c
@@ -20,6 +20,7 @@
 #include <sys/param.h>
 #include "pthread.h"
 #include "internals.h"
+#include <shlib-compat.h>
 
 int __pthread_attr_init_2_1(pthread_attr_t *attr)
 {
@@ -36,9 +37,11 @@ int __pthread_attr_init_2_1(pthread_attr_t *attr)
   attr->__stacksize = STACK_SIZE - ps;
   return 0;
 }
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
-default_symbol_version (__pthread_attr_init_2_1, pthread_attr_init, GLIBC_2.1);
 
+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(pthread_attr_t *attr)
 {
   attr->__detachstate = PTHREAD_CREATE_JOINABLE;
@@ -49,8 +52,6 @@ int __pthread_attr_init_2_0(pthread_attr_t *attr)
   return 0;
 }
 symbol_version (__pthread_attr_init_2_0, pthread_attr_init, GLIBC_2.0);
-#else
-strong_alias (__pthread_attr_init_2_1, pthread_attr_init)
 #endif
 
 int pthread_attr_destroy(pthread_attr_t *attr)
diff --git a/linuxthreads/oldsemaphore.c b/linuxthreads/oldsemaphore.c
index 62d2812693..c6f44cfce2 100644
--- a/linuxthreads/oldsemaphore.c
+++ b/linuxthreads/oldsemaphore.c
@@ -19,6 +19,8 @@
 /* GNU Library General Public License for more details.                 */
 
 /* Semaphores a la POSIX 1003.1b */
+#include <shlib-compat.h>
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
 
 #include <errno.h>
 #include "pthread.h"
@@ -90,7 +92,7 @@ int __old_sem_wait(old_sem_t * sem)
 
     while (1) {
 	/* Register extrication interface */
-	__pthread_set_own_extricate_if(self, &extr); 
+	__pthread_set_own_extricate_if(self, &extr);
 	do {
             oldstatus = sem->sem_status;
             if ((oldstatus & 1) && (oldstatus != 1))
@@ -103,12 +105,12 @@ int __old_sem_wait(old_sem_t * sem)
 	while (! sem_compare_and_swap(sem, oldstatus, newstatus));
 	if (newstatus & 1) {
 	    /* We got the semaphore. */
-	  __pthread_set_own_extricate_if(self, 0); 
+	  __pthread_set_own_extricate_if(self, 0);
 	    return 0;
 	}
 	/* Wait for sem_post or cancellation */
 	suspend(self);
-	__pthread_set_own_extricate_if(self, 0); 
+	__pthread_set_own_extricate_if(self, 0);
 
 	/* This is a cancellation point */
 	if (self->p_canceled && self->p_cancelstate == PTHREAD_CANCEL_ENABLE) {
@@ -224,11 +226,11 @@ static void sem_restart_list(pthread_descr waiting)
   }
 }
 
-#if defined PIC && DO_VERSIONING
 symbol_version (__old_sem_init, sem_init, GLIBC_2.0);
 symbol_version (__old_sem_wait, sem_wait, GLIBC_2.0);
 symbol_version (__old_sem_trywait, sem_trywait, GLIBC_2.0);
 symbol_version (__old_sem_post, sem_post, GLIBC_2.0);
 symbol_version (__old_sem_getvalue, sem_getvalue, GLIBC_2.0);
 symbol_version (__old_sem_destroy, sem_destroy, GLIBC_2.0);
+
 #endif
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index e5010b9261..6ac7bc9170 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -517,7 +517,7 @@ int __pthread_create_2_1(pthread_t *thread, const pthread_attr_t *attr,
 
 versioned_symbol (libpthread, __pthread_create_2_1, pthread_create, GLIBC_2_1);
 
-#if SHLIB_COMPAT (libpthread, GLIBC_2_0)
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1)
 
 int __pthread_create_2_0(pthread_t *thread, const pthread_attr_t *attr,
 			 void * (*start_routine)(void *), void *arg)
diff --git a/linuxthreads/semaphore.c b/linuxthreads/semaphore.c
index 0297b3a1e3..c4a4f6e042 100644
--- a/linuxthreads/semaphore.c
+++ b/linuxthreads/semaphore.c
@@ -21,6 +21,7 @@
 #include "spinlock.h"
 #include "restart.h"
 #include "queue.h"
+#include <shlib-compat.h>
 
 int __new_sem_init(sem_t *sem, int pshared, unsigned int value)
 {
@@ -71,7 +72,7 @@ int __new_sem_wait(sem_t * sem)
     return 0;
   }
   /* Register extrication interface */
-  __pthread_set_own_extricate_if(self, &extr); 
+  __pthread_set_own_extricate_if(self, &extr);
   /* Enqueue only if not already cancelled. */
   if (!(THREAD_GETMEM(self, p_canceled)
       && THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE))
@@ -81,13 +82,13 @@ int __new_sem_wait(sem_t * sem)
   __pthread_unlock((struct _pthread_fastlock *) &sem->__sem_lock);
 
   if (already_canceled) {
-    __pthread_set_own_extricate_if(self, 0); 
+    __pthread_set_own_extricate_if(self, 0);
     pthread_exit(PTHREAD_CANCELED);
-  } 
+  }
 
   /* Wait for sem_post or cancellation, or fall through if already canceled */
   suspend(self);
-  __pthread_set_own_extricate_if(self, 0); 
+  __pthread_set_own_extricate_if(self, 0);
 
   /* Terminate only if the wakeup came from cancellation. */
   /* Otherwise ignore cancellation because we got the semaphore. */
@@ -189,21 +190,9 @@ int sem_unlink(const char *name)
   return -1;
 }
 
-#if defined PIC && DO_VERSIONING
-default_symbol_version (__new_sem_init, sem_init, GLIBC_2.1);
-default_symbol_version (__new_sem_wait, sem_wait, GLIBC_2.1);
-default_symbol_version (__new_sem_trywait, sem_trywait, GLIBC_2.1);
-default_symbol_version (__new_sem_post, sem_post, GLIBC_2.1);
-default_symbol_version (__new_sem_getvalue, sem_getvalue, GLIBC_2.1);
-default_symbol_version (__new_sem_destroy, sem_destroy, GLIBC_2.1);
-#else
-# ifdef weak_alias
-weak_alias (__new_sem_init, sem_init)
-weak_alias (__new_sem_wait, sem_wait)
-weak_alias (__new_sem_trywait, sem_trywait)
-weak_alias (__new_sem_post, sem_post)
-weak_alias (__new_sem_getvalue, sem_getvalue)
-weak_alias (__new_sem_destroy, sem_destroy)
-# endif
-#endif
-    
+versioned_symbol (libpthread, __new_sem_init, sem_init, GLIBC_2_1);
+versioned_symbol (libpthread, __new_sem_wait, sem_wait, GLIBC_2_1);
+versioned_symbol (libpthread, __new_sem_trywait, sem_trywait, GLIBC_2_1);
+versioned_symbol (libpthread, __new_sem_post, sem_post, GLIBC_2_1);
+versioned_symbol (libpthread, __new_sem_getvalue, sem_getvalue, GLIBC_2_1);
+versioned_symbol (libpthread, __new_sem_destroy, sem_destroy, GLIBC_2_1);
diff --git a/linuxthreads/weaks.c b/linuxthreads/weaks.c
index d6d028f2ec..a91f5cfb02 100644
--- a/linuxthreads/weaks.c
+++ b/linuxthreads/weaks.c
@@ -1,5 +1,5 @@
 /* The weak pthread functions for Linux.
-   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -20,20 +20,19 @@
 #include <errno.h>
 #include <limits.h>
 #include <stdlib.h>
+#include <shlib-compat.h>
 
 extern int __pthread_return_0 (void);
 extern int __pthread_return_1 (void);
 extern void __pthread_return_void (void);
 
 /* Those are pthread functions which return 0 if successful. */
-#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
-weak_alias (__pthread_return_0, __libc_pthread_attr_init_2_0)
-symbol_version (__libc_pthread_attr_init_2_0, pthread_attr_init, GLIBC_2.0);
 weak_alias (__pthread_return_0, __libc_pthread_attr_init_2_1)
-default_symbol_version (__libc_pthread_attr_init_2_1, pthread_attr_init,
-			GLIBC_2.1);
-#else
-weak_alias (__pthread_return_0, pthread_attr_init)
+versioned_symbol (libpthread, __libc_pthread_attr_init_2_1, pthread_attr_init,
+		  GLIBC_2_1);
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
+weak_alias (__pthread_return_0, __libc_pthread_attr_init_2_0)
+symbol_version (__libc_pthread_attr_init_2_, pthread_attr_init, GLIBC_2.0);
 #endif
 weak_alias (__pthread_return_0, pthread_attr_destroy)
 weak_alias (__pthread_return_0, pthread_attr_setdetachstate)