glibc/sysdeps
Zack Weinberg 1711991592 Remove _IO_MTSAFE_IO from public headers.
_IO_MTSAFE_IO controls whether stdio is *built* with support for
multithreading.  In the distant past it might also have worked as a
feature selection macro, allowing library *users* to select
thread-safe or lock-free stdio at application build time, I haven't
done the archaeology.  Nowadays, defining _IO_MTSAFE_IO while using
the installed headers, or in _ISOMAC mode, will cause libio.h to throw
syntax errors.

This patch removes _IO_MTSAFE_IO from the public headers
(specifically, from libio/libio.h).  The most important thing it
controlled in there was whether libio.h defines _IO_lock_t itself or
expects stdio-lock.h to have done it, and we do still need a
inter-header communication macro for that, because stdio-lock.h can
only define _IO_lock_t as a typedef.  I've invented
_IO_lock_t_defined, which is defined by both versions of stdio-lock.h.

_IO_MTSAFE_IO also controlled the definitions of a handful of macros
that _might_ count as part of the public libio.h interface.  They are
now unconditionally given their non-_IO_MTSAFE_IO definition in
libio/libio.h, and include/libio.h redefines them with the
_IO_MTSAFE_IO definition.  This should minimize the odds of breaking
old software that actually uses those macros.

I suspect that this entire mechanism is vestigial, and that glibc
won't build anymore if you *don't* define _IO_MTSAFE_IO, but that's
another patchset.  The bulk of libio.h is internal-use-only stuff that
no longer makes sense to expose (libstdc++ gave up on making a FILE
the same object as a C++ filebuf *decades* ago) but that, too, is
another patchset.

	* libio/libio.h: Condition dummy definition of _IO_lock_t on
	_IO_lock_t_defined, not _IO_MTSAFE_IO. Unconditionally use the
	non-_IO_MTSAFE_IO definitions for _IO_peekc, _IO_flockfile,
	_IO_funlockfile, and _IO_ftrylockfile.  Only define
	_IO_cleanup_region_start and _IO_cleanup_region_end if not
	already defined.
	* include/libio.h: If _IO_MTSAFE_IO is defined, redefine
        _IO_peekc, _IO_flockfile, _IO_funlockfile, and _IO_ftrylockfile
        appropriately.
	* sysdeps/generic/stdio-lock.h, sysdeps/nptl/stdio-lock.h:
	Define _IO_lock_t_defined after defining _IO_lock_t.
2017-05-11 19:14:11 -04:00
..
aarch64 Move shared pthread definitions to common headers 2017-05-09 17:49:17 -03:00
alpha Move shared pthread definitions to common headers 2017-05-09 17:49:17 -03:00
arm Condition some sys/ucontext.h contents on __USE_MISC (bug 21457). 2017-05-11 14:15:26 +00:00
generic Remove _IO_MTSAFE_IO from public headers. 2017-05-11 19:14:11 -04:00
gnu Add TCP_FASTOPEN_CONNECT from Linux 4.11 to netinet/tcp.h. 2017-05-01 16:18:31 +00:00
hppa Remove wrong definitions from pthread header refactor 2017-05-11 10:46:03 -03:00
i386 Condition some sys/ucontext.h contents on __USE_MISC (bug 21457). 2017-05-11 14:15:26 +00:00
ia64 Move shared pthread definitions to common headers 2017-05-09 17:49:17 -03:00
ieee754 float128: Add _Float128 make bits to libm. 2017-05-09 11:40:28 -03:00
init_array Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
m68k Condition some sys/ucontext.h contents on __USE_MISC (bug 21457). 2017-05-11 14:15:26 +00:00
mach [BZ 21340] add support for POSIX_SPAWN_SETSID 2017-04-25 08:51:12 -03:00
microblaze Move shared pthread definitions to common headers 2017-05-09 17:49:17 -03:00
mips Condition some sys/ucontext.h contents on __USE_MISC (bug 21457). 2017-05-11 14:15:26 +00:00
nacl Assume that accept4 is always available and works 2017-04-19 07:44:48 +02:00
nios2 Move shared pthread definitions to common headers 2017-05-09 17:49:17 -03:00
nptl Remove _IO_MTSAFE_IO from public headers. 2017-05-11 19:14:11 -04:00
posix getaddrinfo: Unconditionally use malloc for address list 2017-05-11 10:01:49 +02:00
powerpc powerpc: Fix signal handling in backtrace 2017-05-11 17:27:31 -03:00
pthread Refer to <signal.h> instead of <pthread.h> in <bits/sigthread.h> 2017-02-28 10:34:15 +01:00
s390 Move shared pthread definitions to common headers 2017-05-09 17:49:17 -03:00
sh Move shared pthread definitions to common headers 2017-05-09 17:49:17 -03:00
sparc Move shared pthread definitions to common headers 2017-05-09 17:49:17 -03:00
tile Move shared pthread definitions to common headers 2017-05-09 17:49:17 -03:00
unix Consolidate Linux writev implementation 2017-05-11 17:27:31 -03:00
wordsize-32 Build divdi3 only for architecture that required it 2017-04-06 15:14:34 -03:00
wordsize-64 Add missing header files throughout the testsuite. 2017-02-16 17:33:18 -05:00
x86 Move shared pthread definitions to common headers 2017-05-09 17:49:17 -03:00
x86_64 x86: Set dl_platform and dl_hwcap from CPU features [BZ #21391] 2017-05-03 13:44:35 -07:00