]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
environ.7: Relocate and reword the mention of _GNU_SOURCE
authorMichael Kerrisk <mtk.manpages@gmail.com>
Thu, 28 Jan 2021 09:08:05 +0000 (10:08 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Thu, 28 Jan 2021 11:10:52 +0000 (12:10 +0100)
Using _GNU_SOURCE to obtain the declaration of 'environ' is
nonstandard. Therefore, move the mention of this detail to NOTES.
At the same time, add a few words proposed by Bastien.

Cowritten-by: Bastien Roucariès <rouca@debian.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man7/environ.7

index 182d823d233c543b33458b0984cd8bfde7e71a62..dac7f94bdf8fe6a30d279f958fbd22ab01381b47 100644 (file)
@@ -43,12 +43,6 @@ The variable
 .I environ
 points to an array of pointers to strings called the "environment".
 The last pointer in this array has the value NULL.
-(This variable must be declared in the user program,
-but is declared in the header file
-.I <unistd.h>
-if the
-.B _GNU_SOURCE
-feature test macro is defined.)
 This array of strings is made available to the process by the
 .BR exec (3)
 call that started the process.
@@ -240,6 +234,18 @@ may specify the desired printer to use.
 See
 .BR lpr (1).
 .SH NOTES
+Historically and by standard,
+.I environ
+must be declared in the user program.
+However, as a (nonstandard) programmer convenience,
+.I environ
+is declared in the header file
+.I <unistd.h>
+if the
+.B _GNU_SOURCE
+feature test macro is defined (see
+.BR feature_test_macros (7)).
+.PP
 The
 .BR prctl (2)
 .B PR_SET_MM_ENV_START