[PATCH] Fix <bits/libc-lock.h>
Jakub Jelinek
jakub@redhat.com
Mon Aug 27 05:50:00 GMT 2001
On Sun, Aug 26, 2001 at 10:22:39PM -0700, Ulrich Drepper wrote:
> Jakub Jelinek <jakub@redhat.com> writes:
>
> > 2001-08-26 Jakub Jelinek <jakub@redhat.com>
> >
> > * sysdeps/pthread/bits/libc-lock.h (__libc_lock_t): Define
> > non-opaque lock types also if _IO_MTSAFE_IO is defined.
>
> Thanks, I've applied this.
It has one problem - as pthread_rwlock_t is guarded by __USE_UNIX98 and
libio in gcc is not compiled with _GNU_SOURCE nor _XOPEN_SOURCE, compilation
fails on __libc_rwlock_t typedef.
Fixed thusly (just finished gcc-2.96-RH build with this bits/libc-lock.h, so
it already works):
2001-08-27 Jakub Jelinek <jakub@redhat.com>
* sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_t): Only define to
non-opaque type if __USE_UNIX98.
--- linuxthreads/sysdeps/pthread/bits/libc-lock.h.jj Mon Aug 27 03:59:26 2001
+++ linuxthreads/sysdeps/pthread/bits/libc-lock.h Mon Aug 27 08:34:50 2001
@@ -25,8 +25,12 @@
/* Mutex type. */
#if defined(_LIBC) || defined(_IO_MTSAFE_IO)
typedef pthread_mutex_t __libc_lock_t;
-typedef pthread_rwlock_t __libc_rwlock_t;
typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
+# ifdef __USE_UNIX98
+typedef pthread_rwlock_t __libc_rwlock_t;
+# else
+typedef struct __libc_rwlock_opaque__ __libc_rwlock_t;
+# endif
#else
typedef struct __libc_lock_opaque__ __libc_lock_t;
typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
Jakub
More information about the Libc-hacker
mailing list