This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
_REENTRANT should be unused
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: libc-alpha at gcc dot gnu dot org
- Date: Tue, 13 Sep 2005 23:47:56 +0000 (UTC)
- Subject: _REENTRANT should be unused
The feature test macro _REENTRANT has somewhat misleading or out of date
documentation:
@defvr Macro _REENTRANT
@defvrx Macro _THREAD_SAFE
If you define one of these macros, reentrant versions of several functions get
declared. Some of the functions are specified in POSIX.1c but many others
are only available on a few other systems or are unique to GNU libc.
The problem is the delay in the standardization of the thread safe C library
interface.
Unlike on some other systems, no special version of the C library must be
used for linking. There is only one version but while compiling this
it must have been specified to compile as thread safe.
@end defvr
In fact, the *only* uses of __USE_REENTRANT which <features.h> defines
given _REENTRANT or _THREAD_SAFE are to condition the declaration of
getlogin_r in posix/unistd.h
#if defined __USE_REENTRANT || defined __USE_UNIX98
and similarly for the checking version in posix/bits/unistd.h.
__USE_UNIX98 should be __USE_POSIX199506 in this case, as getlogin_r is
included in POSIX.1:1996. __USE_POSIX199506 is defined by default when
users don't use any feature test macros. Given this, the utility of
_REENTRANT to control the declaration of a single function in the special
case where the user has disabled declarations of POSIX.1:1996 functions
seems very doubtful to me. Perhaps the macro, its documentation and the
#define of it in include/libc-symbols.h should be removed?
--
Joseph S. Myers
joseph@codesourcery.com