This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC PATCH] Deprecate _REENTRANT and _THREAD_SAFE.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]