public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Zack Weinberg <zackw@panix.com>
Cc: <libc-alpha@sourceware.org>, <adhemerval.zanella@linaro.org>,
	<Wilco.Dijkstra@arm.com>, <fweimer@redhat.com>,
	<carlos@redhat.com>, <schwab@suse.de>
Subject: Re: [PATCH 01/10] Remove _IO_MTSAFE_IO from public headers.
Date: Tue, 09 May 2017 21:11:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.20.1705092110550.28688@digraph.polyomino.org.uk> (raw)
In-Reply-To: <20170509154103.11973-2-zackw@panix.com>

On Tue, 9 May 2017, Zack Weinberg wrote:

> _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.

OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2017-05-09 21:11 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-09 15:41 [PATCH 00/10] All of my not-yet-reviewed patches Zack Weinberg
2017-05-09 15:41 ` [PATCH 09/10] Remove bits/string2.h Zack Weinberg
2017-05-09 15:41 ` [PATCH 01/10] Remove _IO_MTSAFE_IO from public headers Zack Weinberg
2017-05-09 21:11   ` Joseph Myers [this message]
2017-05-09 15:41 ` [PATCH 08/10] Don't install libio.h or _G_config.h Zack Weinberg
2017-05-09 15:41 ` [PATCH 04/10] Convert signal.h from __need macros to bits/types/ headers Zack Weinberg
2017-05-09 21:36   ` Joseph Myers
2017-05-17 17:41   ` Joseph Myers
2017-05-20 21:03     ` Zack Weinberg
2017-05-09 15:41 ` [PATCH 07/10] Remove __need_IOV_MAX and __need_FOPEN_MAX Zack Weinberg
2017-05-09 15:41 ` [PATCH 02/10] Suppress internal declarations for most of the testsuite Zack Weinberg
2017-05-09 21:28   ` Joseph Myers
2017-05-10 11:56     ` Zack Weinberg
2017-05-12 15:40       ` H.J. Lu
2017-05-12 16:16         ` Zack Weinberg
2017-05-12 16:26           ` H.J. Lu
2017-05-15 14:18   ` [PATCH] Move tst-mutex*8* to tests-internal Tulio Magno Quites Machado Filho
2017-05-20 13:06     ` Zack Weinberg
2017-05-22 14:21       ` Stefan Liebler
2017-05-25 17:55         ` Tulio Magno Quites Machado Filho
2017-05-09 15:41 ` [PATCH 03/10] The bits/types/*.h treatment for stdio and wchar Zack Weinberg
2017-05-09 21:34   ` Joseph Myers
2017-05-10 11:52     ` Zack Weinberg
2017-05-20 21:05       ` Zack Weinberg
2017-05-22 14:56         ` Joseph Myers
2017-05-09 15:56 ` [PATCH 10/10] Remove bits/string.h Zack Weinberg
2017-05-09 15:56 ` [PATCH 05/10] Remove __need macros from errno.h (__need_Emath, __need_error_t) Zack Weinberg
2017-05-09 21:38   ` Joseph Myers
2017-05-10  7:31     ` Florian Weimer
2017-05-10 11:49       ` Joseph Myers
2017-05-10 12:03         ` Florian Weimer
2017-05-11 12:15           ` Zack Weinberg
2017-05-11 14:30             ` Joseph Myers
2017-05-11 14:46               ` Zack Weinberg
2017-05-11 14:53                 ` Florian Weimer
2017-05-11 14:48             ` Florian Weimer
2017-05-11 15:26               ` Joseph Myers
2017-05-11 15:42                 ` Andreas Schwab
2017-05-11 16:10                   ` Joseph Myers
2017-05-11 17:20                     ` Andreas Schwab
2017-05-11 16:19                   ` Florian Weimer
2017-05-11 17:25                     ` Andreas Schwab
2017-05-12  6:23                       ` Florian Weimer
2017-05-15  8:11                         ` Andreas Schwab
2017-05-15  8:13                           ` Florian Weimer
2017-05-15  8:24                             ` Andreas Schwab
2017-05-15  9:08                               ` Florian Weimer
2017-05-09 15:56 ` [PATCH 06/10] Remove __need_list_t and __need_res_state Zack Weinberg
2017-05-10  7:37   ` Florian Weimer
2017-05-20 19:37     ` Zack Weinberg
2017-05-11  0:12 ` [PATCH 00/10] All of my not-yet-reviewed patches Joseph Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1705092110550.28688@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=carlos@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@suse.de \
    --cc=zackw@panix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).