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 feature test macro can be used to expose the function
declaration, and that macro is not defined by default. declaration, and that macro is not defined by default.
.SS Feature test macros understood by glibc .SS Feature test macros understood by glibc
Linux/glibc understands the following feature test macros: The following paragraphs explain how feature test macros are handled
.\" FIXME ? add _ATFILE_SOURCE to this list 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 .TP
.B __STRICT_ANSI__ .B __STRICT_ANSI__
ISO Standard C. ISO Standard C.
@ -133,13 +137,16 @@ flag.
.B _POSIX_C_SOURCE .B _POSIX_C_SOURCE
Defining this macro with the value 1 causes header files to expose Defining this macro with the value 1 causes header files to expose
definitions conforming to POSIX.1-1990 and ISO C (1990). 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. 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). 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). 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). to the POSIX.1-2001 base specification (excluding the XSI extension).
.TP .TP
.B _POSIX_SOURCE .B _POSIX_SOURCE
@ -201,7 +208,7 @@ large files with only a recompilation being required.)
and on those systems this macro has no effect. and on those systems this macro has no effect.
.TP .TP
.B _BSD_SOURCE .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. BSD-derived definitions.
Defining this macro also causes BSD definitions to be preferred in Defining this macro also causes BSD definitions to be preferred in
some situations where standards conflict, unless one or more of some situations where standards conflict, unless one or more of
@ -215,13 +222,13 @@ or
is defined, in which case BSD definitions are disfavored. is defined, in which case BSD definitions are disfavored.
.TP .TP
.B _SVID_SOURCE .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. System V-derived definitions.
(SVID == System V Interface Definition; see (SVID == System V Interface Definition; see
.BR standards (7).) .BR standards (7).)
.TP .TP
.B _ATFILE_SOURCE .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"; declarations of a range of functions with the suffix "at";
see see
.BR openat (2). .BR openat (2).
@ -236,7 +243,8 @@ Defining this macro (with any value) is equivalent to defining
.BR _XOPEN_SOURCE_EXTENDED , .BR _XOPEN_SOURCE_EXTENDED ,
.BR _POSIX_SOURCE , .BR _POSIX_SOURCE ,
.BR _POSIX_C_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 .BR _XOPEN_SOURCE
with the value 600 (500 in glibc versions before 2.2). with the value 600 (500 in glibc versions before 2.2).
In addition, various GNU-specific extensions are also exposed. 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. since version 4.0.
.SS Default definitions, implicit definitions, and combining definitions .SS Default definitions, implicit definitions, and combining definitions
.PP .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 _BSD_SOURCE ,
.BR _SVID_SOURCE , .BR _SVID_SOURCE ,
.BR _POSIX_SOURCE , .BR _POSIX_SOURCE ,
and and
.BR _POSIX_C_SOURCE =200112L .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 .PP
If any of If any of
.BR __STRICT_ANSI__ , .BR __STRICT_ANSI__ ,
@ -354,7 +364,7 @@ if
is defined with a value greater than or equal to 500 and less than 600; is defined with a value greater than or equal to 500 and less than 600;
or or
.IP \(bu .IP \(bu
200112L (199506L in glibc versions before 2.5), 200112L (199506L in glibc versions before 2.4),
if if
.BR XOPEN_SOURCE .BR XOPEN_SOURCE
is undefined, or is undefined, or
@ -378,13 +388,13 @@ but is employed on some other implementations.
.BR _BSD_SOURCE , .BR _BSD_SOURCE ,
.BR _SVID_SOURCE , .BR _SVID_SOURCE ,
.BR _ATFILE_SOURCE ,
.BR _GNU_SOURCE , .BR _GNU_SOURCE ,
.BR _FORTIFY_SOURCE , .BR _FORTIFY_SOURCE ,
.BR _REENTRANT , .BR _REENTRANT ,
and and
.BR _THREAD_SAFE .BR _THREAD_SAFE
are Linux (glibc) specific. are Linux (glibc) specific.
.\" FIXME ? add _ATFILE_SOURCE to this list
.SH NOTES .SH NOTES
.I <features.h> .I <features.h>
is a Linux/glibc specific header file. is a Linux/glibc specific header file.