This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC PATCH] Deprecate _REENTRANT and _THREAD_SAFE.
- From: Zack Weinberg <zackw at panix dot com>
- To: Michael Kerrisk <mtk dot manpages at gmail dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Thu, 8 Dec 2016 09:01:35 -0500
- Subject: Re: [RFC PATCH] Deprecate _REENTRANT and _THREAD_SAFE.
- Authentication-results: sourceware.org; auth=none
- References: <20161206152204.2064-1-zackw@panix.com> <CALxWeYozGxUHi8wPhHd4fgx=DPtg4UG0UC2Znq7HfOd2JJxBmA@mail.gmail.com>
On Thu, Dec 8, 2016 at 4:01 AM, Michael Kerrisk <mtk.manpages@gmail.com> wrote:
>
> On the assumption that this patch will be merged in some form, I've
> queued the following change to feature_test_macros(7):
I appreciate the vote of confidence, but please don't actually put
that into the manpages until the patch does get merged. Also, some
corrections/clarifications:
> +Historically,
> +defining this macro exposed definitions of certain reentrant functions.
Historically, it was necessary to define this macro in all
multithreaded code. Some C libraries may still require this.
> +However, already for many years this macro has had few effects,
> +and since glibc 2.3, no effects that were not also achieved by defining
> +.BR _POSIX_C_SOURCE
> +with a value of 199606L or greater.
However, glibc has been thread-safe by default for many years; since
glibc 2.3, the only effect of
.B _REENTRANT
has been to enable some of the same declarations enabled by defining
.B _POSIX_C_SOURCE
with a value of 199606L or later.
> +This macro is now deprecated; since glibc 2.25,
> +defining it has the same effect as defining
> +.BR _POSIX_C_SOURCE
> +with a value of 199606L or greater.
In glibc 2.25 and later,
.B _REENTRANT
is deprecated. Defining it is equivalent to defining
.B _POSIX_C_SOURCE
with the value 199606L. If a higher POSIX conformance level is
selected by any other means (such as
.B _POSIX_C_SOURCE
itself,
.BR _XOPEN_SOURCE ,
.BR _DEFAULT_SOURCE ,
or
.BR _GNU_SOURCE ),
then
.B _REENTRANT
has no effect.
(Perhaps there is a tighter way to write the markup? Feel free to tweak.)
zw