]> git.ipfire.org Git - thirdparty/man-pages.git/commit
feature_test_macros.7: Improve the text on _REENTRANT/_THREAD_SAFE deprecation
authorMichael Kerrisk <mtk.manpages@gmail.com>
Fri, 9 Dec 2016 10:22:08 +0000 (11:22 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sat, 10 Dec 2016 14:20:21 +0000 (15:20 +0100)
commitf74991beedcc849956c11888adbfddd6cde7a3c6
tree58d5853da0e1aa4511b0ca819869fb020500ebcf
parent790980e0042aad0364becc42a10c6eba59298f07
feature_test_macros.7: Improve the text on _REENTRANT/_THREAD_SAFE deprecation

[mtk] I did a little code spelunking and found the following:

1. In glibc 1.09 (tagged 1995-03-02 in the git history),
   __USE_REENTRANT, _THREAD_SAFE, and _REENTRANT do not appear.

2. In glibc-1.93 (tagged 1996-08-29 in the git history),
   __USE_REENTRANT governs the exposure of some "_r()"
   functions from about a dozen header files.  However, it is
   defined in <features.h> via

        #if defined (__USE_GNU) || defined (__USE_MISC)
        #define __USE_REENTRANT 1
        #endif

   _REENTRANT and _THREAD_SAFE solely govern declarations in
   <stdio.h>, where they expose declarations of a few "unlocked"
   stdio functions and use #define to redirect a few stdio
   function names to "locked" versions.

3. THREAD_SAFE and _REENTRANT first appear in the git logs
   1996-05-09.

4. About 9 months later, glibc 2.0.1 arrives on 1997-02-04
   (timestamp and tarball taken from
   https://ftp.gnu.org/gnu/libc/, since there is no tag in the
   git history; casual inspection of the logs suggests the
   glibc 2.0 release was about a week earlier.

   By now we have the following in <features.h>:

        #if defined _REENTRANT || defined _THREAD_SAFE
        #define __USE_REENTRANT 1
        #endif

   And _THREAD_SAFE, and _REENTRANT do not appear appear in
   other headers. However, by now, __USE_REENTRANT governs only
   the declarations of tmpnam_r() and getlogin_r()

In other words, the window of time where _REENTRANT and
_THREAD_SAFE did anything much in glibc was quite short, IIUC.

Cowritten-by: Zack Weinberg <zackw@panix.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man7/feature_test_macros.7