aboutsummaryrefslogtreecommitdiffstats
path: root/man7
diff options
context:
space:
mode:
Diffstat (limited to 'man7')
-rw-r--r--man7/feature_test_macros.762
1 files changed, 61 insertions, 1 deletions
diff --git a/man7/feature_test_macros.7 b/man7/feature_test_macros.7
index 09902f821e..7c0000a4fc 100644
--- a/man7/feature_test_macros.7
+++ b/man7/feature_test_macros.7
@@ -122,10 +122,70 @@ 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
-The following paragraphs explain how feature test macros are handled
+The paragraphs below explain how feature test macros are handled
in Linux glibc 2.\fIx\fP,
.I x
> 0.
+
+First, though a summary of a few details for the impatient:
+.IP * 3
+The macros that you most likely need to use in modern source code are
+.BR _POSIX_C_SOURCE
+(for definitions from various versions of POSIX.1),
+.BR _XOPEN_SOURCE
+(fof definitions from various versions of SUS),
+.BR _GNU_SOURCE
+(for GNU and/or Linux specific stuff), and
+.BR _DEFAULT_SOURCE
+(to get definitions that would normally be provided by default).
+.IP *
+Defining
+.BR _XOPEN_SOURCE
+with a value of 600 or greater produces the same effects as defining
+.BR _POSIX_C_SOURCE
+with a value of 200112L or greater.
+Where one sees
+.RS
+.nf
+
+ _POSIX_C_SOURCE >= 200112L
+
+.fi
+.RE
+.IP
+in the feature test macro requirements in the SYNOPSIS of a man page,
+it is implicit that the following has the same effect:
+.RS
+.nf
+
+ _XOPEN_SOURCE >= 600
+
+.fi
+.RE
+.IP *
+Defining
+.BR _XOPEN_SOURCE
+with a value of 700 or greater produces the same effects as defining
+.BR _POSIX_C_SOURCE
+with a value of 200809L or greater.
+Where one sees
+.RS
+.nf
+
+ _POSIX_C_SOURCE >= 200809L
+
+.fi
+.RE
+.IP
+in the feature test macro requirements in the SYNOPSIS of a man page,
+it is implicit that the following has the same effect:
+.RS
+.nf
+
+ _XOPEN_SOURCE >= 700
+
+.fi
+.RE
.\" The details in glibc 2.0 are simpler, but combining a
.\" a description of them with the details in later glibc versions
.\" would make for a complicated description.