]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/proc_pid_environ.5
proc.5, proc_fb.5: Split /proc/fb from proc(5)
[thirdparty/man-pages.git] / man5 / proc_pid_environ.5
CommitLineData
49ae7926
AC
1.\" Copyright (C) 1994, 1995, Daniel Quinlan <quinlan@yggdrasil.com>
2.\" Copyright (C) 2002-2008, 2017, Michael Kerrisk <mtk.manpages@gmail.com>
3.\" Copyright (C) 2023, Alejandro Colomar <alx@kernel.org>
4.\"
5.\" SPDX-License-Identifier: GPL-3.0-or-later
6.\"
7.TH proc_pid_environ 5 (date) "Linux man-pages (unreleased)"
8.SH NAME
9/proc/pid/environ \- initial environment
10.SH DESCRIPTION
11.TP
12.IR /proc/ pid /environ
13This file contains the initial environment that was set
14when the currently executing program was started via
15.BR execve (2).
16The entries are separated by null bytes (\[aq]\e0\[aq]),
17and there may be a null byte at the end.
18Thus, to print out the environment of process 1, you would do:
19.IP
20.in +4n
21.EX
22.RB "$" " cat /proc/1/environ | tr \[aq]\e000\[aq] \[aq]\en\[aq]"
23.EE
24.in
25.IP
26If, after an
27.BR execve (2),
28the process modifies its environment
29(e.g., by calling functions such as
30.BR putenv (3)
31or modifying the
32.BR environ (7)
33variable directly),
34this file will
35.I not
36reflect those changes.
37.IP
38Furthermore, a process may change the memory location that this file refers via
39.BR prctl (2)
40operations such as
41.BR PR_SET_MM_ENV_START .
42.IP
43Permission to access this file is governed by a ptrace access mode
44.B PTRACE_MODE_READ_FSCREDS
45check; see
46.BR ptrace (2).
47.SH SEE ALSO
48.BR proc (5)