[PATCH] Fix recent <bits/stdio-lock.h> breakage (take 2)

Jakub Jelinek jakub@redhat.com
Sun Aug 26 14:11:00 GMT 2001


On Sun, Aug 26, 2001 at 04:55:52PM -0400, Roland McGrath wrote:
> That seems kind of ugly to me, especially copying the type definitions.
> 
> Perhaps the simplest thing to do is treat _IO_MTSAFE_IO like _LIBC in
> libc-lock.h, so it defines all the real types when building libio.
> 
> That is sort of unkosher, but using libio's _IO_MTSAFE_IO like this in
> libc seems morally equivalent to libio's unkosher use of <bits/*.h> headers.

Agreed. Here is a patch for this:

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.

--- libc/linuxthreads/sysdeps/pthread/bits/libc-lock.h.jj	Fri Aug 24 11:09:51 2001
+++ libc/linuxthreads/sysdeps/pthread/bits/libc-lock.h	Sun Aug 26 23:25:46 2001
@@ -23,7 +23,7 @@
 #include <pthread.h>
 
 /* Mutex type.  */
-#ifdef _LIBC
+#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;


	Jakub



More information about the Libc-hacker mailing list