mirror of https://github.com/mkerrisk/man-pages
proc.5: Clarify that /proc/PID/environ is set at time of execve(2)
Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
387e243882
commit
09651080d1
12
man5/proc.5
12
man5/proc.5
|
@ -477,7 +477,9 @@ check; see
|
||||||
.BR ptrace (2).
|
.BR ptrace (2).
|
||||||
.TP
|
.TP
|
||||||
.I /proc/[pid]/environ
|
.I /proc/[pid]/environ
|
||||||
This file contains the initial environment for the process.
|
This file contains the initial environment that was set
|
||||||
|
when the currently executing program was started via
|
||||||
|
.BR execve (2).
|
||||||
The entries are separated by null bytes (\(aq\\0\(aq),
|
The entries are separated by null bytes (\(aq\\0\(aq),
|
||||||
and there may be a null byte at the end.
|
and there may be a null byte at the end.
|
||||||
Thus, to print out the environment of process 1, you would do:
|
Thus, to print out the environment of process 1, you would do:
|
||||||
|
@ -488,13 +490,17 @@ Thus, to print out the environment of process 1, you would do:
|
||||||
.fi
|
.fi
|
||||||
.in
|
.in
|
||||||
|
|
||||||
Once a process starts modifying its environment
|
If, after an
|
||||||
|
.BR execve (2),
|
||||||
|
the process modifies its environment
|
||||||
(e.g. by calling functions such as
|
(e.g. by calling functions such as
|
||||||
.BR putenv (3)
|
.BR putenv (3)
|
||||||
or modifying the
|
or modifying the
|
||||||
.BR environ (7)
|
.BR environ (7)
|
||||||
variable directly),
|
variable directly),
|
||||||
this file will not be kept up to date.
|
this file will
|
||||||
|
.I not
|
||||||
|
reflect those changes.
|
||||||
|
|
||||||
Further, a process may change the memory this points to by calling
|
Further, a process may change the memory this points to by calling
|
||||||
.BR prctl (2)
|
.BR prctl (2)
|
||||||
|
|
Loading…
Reference in New Issue