about summary refs log tree commit diff
path: root/linuxthreads
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-02-28 05:08:01 +0000
committerUlrich Drepper <drepper@redhat.com>2000-02-28 05:08:01 +0000
commit0ed99ce46d9521347c2fd1c72f7b4e9aa0e3f4d0 (patch)
tree5aa27fb2d06f760ba64c7424d36f2bf91a1940f9 /linuxthreads
parent919e98fa39e74f1bbd5c4b0b21edbce3d293f03f (diff)
downloadglibc-0ed99ce46d9521347c2fd1c72f7b4e9aa0e3f4d0.tar.gz
glibc-0ed99ce46d9521347c2fd1c72f7b4e9aa0e3f4d0.tar.xz
glibc-0ed99ce46d9521347c2fd1c72f7b4e9aa0e3f4d0.zip
Update.
2000-02-27  Ulrich Drepper  <drepper@redhat.com>

	* conform/conformtest.pl (@headers): Add wordexp.h, wctype.h, wchar.h,
	varargs.h, utmpx.h, utime.h, unistd.h, ulimit.h, ucontext.h, time.h,
	termios.h, tar.h, sys/wait.h, sys/uio.h, sys/types.h, sys/times.h,
	sys/timeb.h, sys/time.h, sys/statvfs.h, sys/stat.h, sys/shm.h,
	sys/sem.h, and sys/resource.h.
	Implement handling of allow-header.
	* conform/data/fcntl.h-data: Correct various bugs.
	* conform/data/fnmatch.h-data: Likewise.
	* conform/data/math.h-data: Likewise.
	* conform/data/ndbm.h-data: Likewise.
	* conform/data/nl_types.h-data: Likewise.
	* conform/data/poll.h-data: Likewise.
	* conform/data/pthread.h-data: Likewise.
	* conform/data/semaphore.h-data: Likewise.
	* conform/data/setjmp.h-data: Likewise.
	* conform/data/signal.h-data: Likewise.
	* conform/data/stdarg.h-data: Likewise.
	* conform/data/stddef.h-data: Likewise.
	* conform/data/stdio.h-data: Likewise.
	* conform/data/stdlib.h-data: Likewise.
	* conform/data/string.h-data: Likewise.
	* conform/data/strings.h-data: Likewise.
	* conform/data/stropts.h-data: Likewise.
	* conform/data/syslog.h-data: Likewise.
	* conform/data/sys/ipc.h-data: Likewise.
	* conform/data/sys/mman.h-data: Likewise.
	* conform/data/sys/msg.h-data: Likewise.
	* conform/data/tar.h-data: New file.
	* conform/data/termios.h-data: New file.
	* conform/data/time.h-data: New file.
	* conform/data/ucontext.h-data: New file.
	* conform/data/ulimit.h-data: New file.
	* conform/data/unistd.h-data: New file.
	* conform/data/utime.h-data: New file.
	* conform/data/utmpx.h-data: New file.
	* conform/data/varargs.h-data: New file.
	* conform/data/wchar.h-data: New file.
	* conform/data/wctype.h-data: New file.
	* conform/data/wordexp.h-data: New file.
	* conform/data/sys/resource.h-data: New file.
	* conform/data/sys/sem.h-data: New file.
	* conform/data/sys/shm.h-data: New file.
	* conform/data/sys/stat.h-data: New file.
	* conform/data/sys/statvfs.h-data: New file.
	* conform/data/sys/time.h-data: New file.
	* conform/data/sys/timeb.h-data: New file.
	* conform/data/sys/times.h-data: New file.
	* conform/data/sys/types.h-data: New file.
	* conform/data/sys/uio.h-data: New file.
	* conform/data/sys/wait.h-data: New file.

	* grp/grp.h (getgrent_r): Declare only if __USE_GNU.

	* include/sys/time.h (__itimes): Fix type of second parameter.

	* io/sys/stat.h (S_IFLNK): Define also if __USE_XOPEN.
	(S_ISVTX): Likewise.

	* io/sys/statvfs.h: Define fsblkcnt_t and fsfilcnt_t.

	* locale/langindo.h: Make ERA_YEAR, INT_CURR_SYMBOL, CURRENCY_SYMBOL,
	MON_DECIMAL_POINT, MON_THOUSANDS_SEP, MON_GROUPING, POSITIVE_SIGN,
	NEGATIVE_SIGN, INT_FRAC_DIGITS, FRAC_DIGITS, P_CS_PRECEDES,
	P_SEP_BY_SPACE, N_CS_PRECEDES, N_SEP_BY_SPACE, P_SIGN_POSN,
	N_SIGN_POSN, DECIMAL_POINT, THOUSANDS_SEP, GROUPING, YESEXPR,
	NOEXPR, YESSTR, and NOSTR only available if __USE_GNU.

	* math/bits/mathcalls.h: Don't declare tgamma and scalbn if only
	__USE_XOPEN.

	* posix/unistd.h: Don't define ptrdiff_t.
	(sbrk): Correct type of parameter.
	* sysdeps/generic/sbrk.c: Likewise.
	* sysdeps/mach/hurd/sbrk.c: Likewise.

	* posix/sys/types.h: Allow id_t, suseconds_t, fsblkcnt_t, and
	fsfilcnt_t being defined elsewhere.

	* resource/sys/resource.h: Define id_t.
	If __USE_XOPEN use int for type of first parameter if getrlimit,
	getrlimit64, setrlimit, setrlimit64, getrusage, getpriority, and
	setpriority.
	* sysdeps/generic/getpriority.c: Fix type of second parameter.
	* sysdeps/generic/setpriority.c: Likewise.
	* sysdeps/mach/hurd/getpriority.c: Likewise.
	* sysdeps/mach/hurd/setpriority.c: Likewise.
	* sysdeps/unix/sysv/irix4/getpriority.c: Likewise.
	* sysdeps/unix/sysv/irix4/setpriority.c: Likewise.
	* sysdeps/unix/sysv/linux/getpriority.c: Likewise.

	* sysdeps/generic/utimes.c: Fix parameter of third parameter.
	* sysdeps/mach/hurd/utimes.c: Likewise.
	* sysdeps/posix/utimes.c: Likewise.

	* sysdeps/generic/bits/shm.h: Define shmatt_t type and use it in
	struct shmid_ds definition.
	* sysdeps/gnu/bits/shm.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/shm.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/shm.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/shm.h: Likewise.

	* sysvipc/sys/shm.h: Define time_t.

	* sysvipc/sys/sem.h (struct sembuf): Make sem_num field unsigned.

	* sysdeps/gnu/bits/sem.h: Rename anonymous type struct sem_queue and
	struct sem_undo to struct __sem_queue and struct __sem_undo resp.

	* time/time.h: Define suseconds_t if not already done.

	* sysdeps/unix/sysv/linux/bits/statvfs.h: Rename f_spare to __f_spare.
	* sysdeps/unix/sysv/linux/fstatvfs64.c: Likewise.
	* sysdeps/unix/sysv/linux/statvfs64.c: Likewise.
	* sysdeps/unix/sysv/linux/internal_statvfs.c: Likewise.

	* intl/bindtextdom.c: Use rwlock to avoid surprising results in
	multithreaded applications.
	* intl/dcigettext.c: Likewise.
	* intl/textdomain.c: Likewise.
	* intl/*.c: Update copyright.
	* sysdeps/generic/bits/libc-lock.h: Define __libc_rwlock_* stubs.

2000-02-27  Andreas Jaeger  <aj@suse.de>

	* sysdeps/unix/sysv/linux/configure.in: Treat also "/usr/" as
	prefix especially.

2000-02-27  Ulrich Drepper  <drepper@redhat.com>

	* po/de.po: Update from translation team.
	* po/ko.po: Likewise.
Diffstat (limited to 'linuxthreads')
-rw-r--r--linuxthreads/ChangeLog11
-rw-r--r--linuxthreads/Versions5
-rw-r--r--linuxthreads/rwlock.c26
-rw-r--r--linuxthreads/sysdeps/pthread/bits/libc-lock.h52
4 files changed, 82 insertions, 12 deletions
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 9fcbf92ed2..1179e7f8bf 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,8 +1,15 @@
+2000-02-27  Ulrich Drepper  <drepper@redhat.com>
+
+	* rwlock.c: Define __* variants of the functions and make old names
+	aliases.
+	* Versions [GLIBC_2.2]: Export the __pthread_rwlock_* functions.
+	* sysdeps/pthread/bits/libc-lock.h: Define __libc_rwlock_* macros.
+
 2000-02-25  Andreas Jaeger  <aj@suse.de>
 
 	* Versions: Export pread, __pread64, pread64, pwrite, __pwrite64,
-        pwrite64, lseek64, open64, and __open64 with version 2.2.
-		
+	pwrite64, lseek64, open64, and __open64 with version 2.2.
+
 2000-02-22  Ulrich Drepper  <drepper@redhat.com>
 
 	* semaphore.h (SEM_FAILED): Use 0 not NULL.
diff --git a/linuxthreads/Versions b/linuxthreads/Versions
index 1e93064f41..1b9de67b67 100644
--- a/linuxthreads/Versions
+++ b/linuxthreads/Versions
@@ -124,5 +124,10 @@ libpthread {
     open64; __open64;
 
     __res_state;
+
+    # Names used internally.
+    __pthread_rwlock_init; __pthread_rwlock_destroy; __pthread_rwlock_rdlock;
+    __pthread_rwlock_tryrdlock; __pthread_rwlock_wrlock;
+    __pthread_rwlock_trywrlock; __pthread_rwlock_unlock;
   }
 }
diff --git a/linuxthreads/rwlock.c b/linuxthreads/rwlock.c
index e1401c3c0c..0dd714bc39 100644
--- a/linuxthreads/rwlock.c
+++ b/linuxthreads/rwlock.c
@@ -183,7 +183,7 @@ rwlock_have_already(pthread_descr *pself, pthread_rwlock_t *rwlock,
 }
 
 int
-pthread_rwlock_init (pthread_rwlock_t *rwlock,
+__pthread_rwlock_init (pthread_rwlock_t *rwlock,
 		     const pthread_rwlockattr_t *attr)
 {
   __pthread_init_lock(&rwlock->__rw_lock);
@@ -205,10 +205,11 @@ pthread_rwlock_init (pthread_rwlock_t *rwlock,
 
   return 0;
 }
+strong_alias (__pthread_init_lock, pthread_init_lock)
 
 
 int
-pthread_rwlock_destroy (pthread_rwlock_t *rwlock)
+__pthread_rwlock_destroy (pthread_rwlock_t *rwlock)
 {
   int readers;
   _pthread_descr writer;
@@ -223,16 +224,17 @@ pthread_rwlock_destroy (pthread_rwlock_t *rwlock)
 
   return 0;
 }
+strong_alias (__pthread_rwlock_destroy, pthread_rwlock_destroy)
 
 int
-pthread_rwlock_rdlock (pthread_rwlock_t *rwlock)
+__pthread_rwlock_rdlock (pthread_rwlock_t *rwlock)
 {
   pthread_descr self = NULL;
   pthread_readlock_info *existing;
   int out_of_mem, have_lock_already;
 
   have_lock_already = rwlock_have_already(&self, rwlock,
-      &existing, &out_of_mem);
+					  &existing, &out_of_mem);
 
   for (;;)
     {
@@ -262,9 +264,10 @@ pthread_rwlock_rdlock (pthread_rwlock_t *rwlock)
 
   return 0;
 }
+strong_alias (__pthread_rwlock_rdlock, pthread_rwlock_rdlock)
 
 int
-pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock)
+__pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock)
 {
   pthread_descr self = thread_self();
   pthread_readlock_info *existing;
@@ -303,10 +306,11 @@ pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock)
 
   return retval;
 }
+strong_alias (__pthread_rwlock_tryrdlock, pthread_rwlock_tryrdlock)
 
 
 int
-pthread_rwlock_wrlock (pthread_rwlock_t *rwlock)
+__pthread_rwlock_wrlock (pthread_rwlock_t *rwlock)
 {
   pthread_descr self = thread_self ();
 
@@ -326,10 +330,11 @@ pthread_rwlock_wrlock (pthread_rwlock_t *rwlock)
       suspend (self); /* This is not a cancellation point */
     }
 }
+strong_alias (__pthread_rwlock_wrlock, pthread_rwlock_wrlock)
 
 
 int
-pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock)
+__pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock)
 {
   int result = EBUSY;
 
@@ -343,10 +348,11 @@ pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock)
 
   return result;
 }
+strong_alias (__pthread_rwlock_trywrlock, pthread_rwlock_trywrlock)
 
 
 int
-pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
+__pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
 {
   pthread_descr torestart;
   pthread_descr th;
@@ -425,6 +431,7 @@ pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
 
   return 0;
 }
+strong_alias (__pthread_rwlock_unlock, pthread_rwlock_unlock)
 
 
 
@@ -439,10 +446,11 @@ pthread_rwlockattr_init (pthread_rwlockattr_t *attr)
 
 
 int
-pthread_rwlockattr_destroy (pthread_rwlockattr_t *attr)
+__pthread_rwlockattr_destroy (pthread_rwlockattr_t *attr)
 {
   return 0;
 }
+strong_alias (__pthread_rwlockattr_destroy, pthread_rwlockattr_destroy)
 
 
 int
diff --git a/linuxthreads/sysdeps/pthread/bits/libc-lock.h b/linuxthreads/sysdeps/pthread/bits/libc-lock.h
index 0f412bb9e2..76a56d5058 100644
--- a/linuxthreads/sysdeps/pthread/bits/libc-lock.h
+++ b/linuxthreads/sysdeps/pthread/bits/libc-lock.h
@@ -1,5 +1,5 @@
 /* libc-internal interface for mutex locks.  LinuxThreads version.
-   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
@@ -25,8 +25,10 @@
 /* Mutex type.  */
 #ifdef _LIBC
 typedef pthread_mutex_t __libc_lock_t;
+typedef pthread_rwlock_t __libc_rwlock_t;
 #else
 typedef struct __libc_lock_opaque__ __libc_lock_t;
+typedef struct __libc_rwlock_opaque__ __libc_rwlock_t;
 #endif
 
 /* Type for key to thread-specific data.  */
@@ -41,6 +43,8 @@ typedef pthread_key_t __libc_key_t;
    of libc.  */
 #define __libc_lock_define(CLASS,NAME) \
   CLASS __libc_lock_t NAME;
+#define __libc_rwlock_define(CLASS,NAME) \
+  CLASS __libc_rwlock_t NAME;
 
 /* Define an initialized lock variable NAME with storage class CLASS.
 
@@ -50,6 +54,8 @@ typedef pthread_key_t __libc_key_t;
    section.  */
 #define __libc_lock_define_initialized(CLASS,NAME) \
   CLASS __libc_lock_t NAME;
+#define __libc_rwlock_define_initialized(CLASS,NAME) \
+  CLASS __libc_rwlock_t NAME = PTHREAD_RWLOCK_INITIALIZER;
 
 /* Define an initialized recursive lock variable NAME with storage
    class CLASS.  */
@@ -60,6 +66,8 @@ typedef pthread_key_t __libc_key_t;
    state.  */
 #define __libc_lock_init(NAME) \
   (__pthread_mutex_init != NULL ? __pthread_mutex_init (&(NAME), NULL) : 0);
+#define __libc_rwlock_init(NAME) \
+  (__pthread_rwlock_init != NULL ? __pthread_rwlock_init (&(NAME), NULL) : 0);
 
 /* Same as last but this time we initialize a recursive mutex.  */
 #define __libc_lock_init_recursive(NAME) \
@@ -79,6 +87,8 @@ typedef pthread_key_t __libc_key_t;
    called on a lock variable before the containing storage is reused.  */
 #define __libc_lock_fini(NAME) \
   (__pthread_mutex_destroy != NULL ? __pthread_mutex_destroy (&(NAME)) : 0);
+#define __libc_rwlock_fini(NAME) \
+  (__pthread_rwlock_destroy != NULL ? __pthread_rwlock_destroy (&(NAME)) : 0);
 
 /* Finalize recursive named lock.  */
 #define __libc_lock_fini_recursive(NAME) __libc_lock_fini (NAME)
@@ -86,6 +96,10 @@ typedef pthread_key_t __libc_key_t;
 /* Lock the named lock variable.  */
 #define __libc_lock_lock(NAME) \
   (__pthread_mutex_lock != NULL ? __pthread_mutex_lock (&(NAME)) : 0);
+#define __libc_rwlock_rdlock(NAME) \
+  (__pthread_rwlock_rdlock != NULL ? __pthread_rwlock_rdlock (&(NAME)) : 0);
+#define __libc_rwlock_wrlock(NAME) \
+  (__pthread_rwlock_wrlock != NULL ? __pthread_rwlock_wrlock (&(NAME)) : 0);
 
 /* Lock the recursive named lock variable.  */
 #define __libc_lock_lock_recursive(NAME) __libc_lock_lock (NAME)
@@ -93,6 +107,12 @@ typedef pthread_key_t __libc_key_t;
 /* Try to lock the named lock variable.  */
 #define __libc_lock_trylock(NAME) \
   (__pthread_mutex_trylock != NULL ? __pthread_mutex_trylock (&(NAME)) : 0)
+#define __libc_rwlock_tryrdlock(NAME) \
+  (__pthread_rwlock_tryrdlock != NULL \
+   ? __pthread_rwlock_tryrdlock (&(NAME)) : 0)
+#define __libc_rwlock_trywrlock(NAME) \
+  (__pthread_rwlock_trywrlock != NULL \
+   ? __pthread_rwlock_trywrlock (&(NAME)) : 0)
 
 /* Try to lock the recursive named lock variable.  */
 #define __libc_lock_trylock_recursive(NAME) __libc_lock_trylock (NAME)
@@ -100,6 +120,8 @@ typedef pthread_key_t __libc_key_t;
 /* Unlock the named lock variable.  */
 #define __libc_lock_unlock(NAME) \
   (__pthread_mutex_unlock != NULL ? __pthread_mutex_unlock (&(NAME)) : 0);
+#define __libc_rwlock_unlock(NAME) \
+  (__pthread_rwlock_unlock != NULL ? __pthread_rwlock_unlock (&(NAME)) : 0);
 
 /* Unlock the recursive named lock variable.  */
 #define __libc_lock_unlock_recursive(NAME) __libc_lock_unlock (NAME)
@@ -187,6 +209,21 @@ extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr);
 extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr,
 					int __kind);
 
+extern int __pthread_rwlock_init (pthread_rwlock_t *__rwlock,
+				  __const pthread_rwlockattr_t *__attr);
+
+extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock);
+
 extern int __pthread_key_create (pthread_key_t *__key,
 				 void (*__destr_function) (void *));
 
@@ -216,6 +253,13 @@ weak_extern (__pthread_mutex_unlock)
 weak_extern (__pthread_mutexattr_init)
 weak_extern (__pthread_mutexattr_destroy)
 weak_extern (__pthread_mutexattr_settype)
+weak_extern (__pthread_rwlock_init)
+weak_extern (__pthread_rwlock_destroy)
+weak_extern (__pthread_rwlock_rdlock)
+weak_extern (__pthread_rwlock_tryrdlock)
+weak_extern (__pthread_rwlock_wrlock)
+weak_extern (__pthread_rwlock_trywrlock)
+weak_extern (__pthread_rwlock_unlock)
 weak_extern (__pthread_key_create)
 weak_extern (__pthread_setspecific)
 weak_extern (__pthread_getspecific)
@@ -233,6 +277,12 @@ weak_extern (_pthread_cleanup_pop_restore)
 #  pragma weak __pthread_mutexattr_init
 #  pragma weak __pthread_mutexattr_destroy
 #  pragma weak __pthread_mutexattr_settype
+#  pragna weak __pthread_rwlock_destroy
+#  pragma weak __pthread_rwlock_rdlock
+#  pragma weak __pthread_rwlock_tryrdlock
+#  pragma weak __pthread_rwlock_wrlock
+#  pragma weak __pthread_rwlock_trywrlock
+#  pragma weak __pthread_rwlock_unlock
 #  pragma weak __pthread_key_create
 #  pragma weak __pthread_setspecific
 #  pragma weak __pthread_getspecific