From: Michael Kerrisk Date: Thu, 28 Jan 2021 09:08:05 +0000 (+0100) Subject: environ.7: Relocate and reword the mention of _GNU_SOURCE X-Git-Tag: man-pages-5.11~263 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc0bcf3cfe85a416ad59996cc9b556297696eded;p=thirdparty%2Fman-pages.git 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 Signed-off-by: Michael Kerrisk --- 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 -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 +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