Many more improvements.

This commit is contained in:
Michael Kerrisk 2007-07-04 18:30:05 +00:00
parent 4769db2436
commit 93d5a2a1b5
1 changed files with 24 additions and 14 deletions

View File

@ -116,8 +116,12 @@ This format is employed in cases where only a single
feature test macro can be used to expose the function
declaration, and that macro is not defined by default.
.SS Feature test macros understood by glibc
Linux/glibc understands the following feature test macros:
.\" FIXME ? add _ATFILE_SOURCE to this list
The following paragraphs explain how feature test macros are handled
in Linux glibc 2.\fIx\fP, \fIx\fP > 0.
.\" The details in glic 2.0 are simpler, but combining a
.\" a description of them with the details in later glibc versions
.\" would make for a complicated description.
Linux glibc understands the following feature test macros:
.TP
.B __STRICT_ANSI__
ISO Standard C.
@ -133,13 +137,16 @@ flag.
.B _POSIX_C_SOURCE
Defining this macro with the value 1 causes header files to expose
definitions conforming to POSIX.1-1990 and ISO C (1990).
Defining with the value L or greater additionally exposes
Defining this macro with the value L or greater additionally exposes
definitions for POSIX.2-1992.
Defining with the value 199309L or greater additionally exposes
Defining this macro with the value 199309L or greater additionally exposes
definitions for POSIX.1b (real-time extensions).
Defining with the value 199506L or greater additionally exposes
.\" 199506L functionality is only available since glibc 2.1
Defining this macro with the value 199506L or greater additionally exposes
definitions for POSIX.1c (threads).
Defining with the value 200112L exposes definitions corresponding
Since glibc 2.3.3,
defining this macro with the value 200112L or greater
exposes definitions corresponding
to the POSIX.1-2001 base specification (excluding the XSI extension).
.TP
.B _POSIX_SOURCE
@ -201,7 +208,7 @@ large files with only a recompilation being required.)
and on those systems this macro has no effect.
.TP
.B _BSD_SOURCE
Defining this macro with any value cause header files to expose
Defining this macro with any value causes header files to expose
BSD-derived definitions.
Defining this macro also causes BSD definitions to be preferred in
some situations where standards conflict, unless one or more of
@ -215,13 +222,13 @@ or
is defined, in which case BSD definitions are disfavored.
.TP
.B _SVID_SOURCE
Defining this macro with any value cause header files to expose
Defining this macro with any value causes header files to expose
System V-derived definitions.
(SVID == System V Interface Definition; see
.BR standards (7).)
.TP
.B _ATFILE_SOURCE
Defining this macro with any value cause header files to expose
Defining this macro with any value causes header files to expose
declarations of a range of functions with the suffix "at";
see
.BR openat (2).
@ -236,7 +243,8 @@ Defining this macro (with any value) is equivalent to defining
.BR _XOPEN_SOURCE_EXTENDED ,
.BR _POSIX_SOURCE ,
.BR _POSIX_C_SOURCE
with the value 200112L (199506L in glibc versions before 2.5), and
with the value 200112L (199506L in glibc versions before 2.5),
.\" 199309L in glibc versions before 2.1
.BR _XOPEN_SOURCE
with the value 600 (500 in glibc versions before 2.2).
In addition, various GNU-specific extensions are also exposed.
@ -300,13 +308,15 @@ Use of this macro requires compiler support, available with
since version 4.0.
.SS Default definitions, implicit definitions, and combining definitions
.PP
The following feature test macros are defined by default:
If no feature test macros are explicitly defined,
then the following feature test macros are defined by default:
.BR _BSD_SOURCE ,
.BR _SVID_SOURCE ,
.BR _POSIX_SOURCE ,
and
.BR _POSIX_C_SOURCE =200112L
(199506L in glibc versions before 2.5).
(199506L in glibc versions before 2.4).
.\" 199309L in glibc versions before 2.1.
.PP
If any of
.BR __STRICT_ANSI__ ,
@ -354,7 +364,7 @@ if
is defined with a value greater than or equal to 500 and less than 600;
or
.IP \(bu
200112L (199506L in glibc versions before 2.5),
200112L (199506L in glibc versions before 2.4),
if
.BR XOPEN_SOURCE
is undefined, or
@ -378,13 +388,13 @@ but is employed on some other implementations.
.BR _BSD_SOURCE ,
.BR _SVID_SOURCE ,
.BR _ATFILE_SOURCE ,
.BR _GNU_SOURCE ,
.BR _FORTIFY_SOURCE ,
.BR _REENTRANT ,
and
.BR _THREAD_SAFE
are Linux (glibc) specific.
.\" FIXME ? add _ATFILE_SOURCE to this list
.SH NOTES
.I <features.h>
is a Linux/glibc specific header file.