diff options
author | Michael Kerrisk <mtk.manpages@gmail.com> | 2021-01-28 10:08:05 +0100 |
---|---|---|
committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2021-01-28 12:10:52 +0100 |
commit | fc0bcf3cfe85a416ad59996cc9b556297696eded (patch) | |
tree | f9295422721bb9fbd577cf23dde63c1255b012da | |
parent | 0efacbdd866bda9efabeeae93599076e3f49f9e0 (diff) | |
download | man-pages-fc0bcf3cfe85a416ad59996cc9b556297696eded.tar.gz |
environ.7: Relocate and reword the mention of _GNU_SOURCE
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>
-rw-r--r-- | man7/environ.7 | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/man7/environ.7 b/man7/environ.7 index 182d823d23..dac7f94bdf 100644 --- a/man7/environ.7 +++ b/man7/environ.7 @@ -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 |