CONTRIBUTING.d/patches: Please provide a git-range-diff(1)
[man-pages.git] / man5 / proc_pid_map_files.5
blobda726dcfc757d66e007d68d7fdb130889f5dc27f
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_map_files 5 (date) "Linux man-pages (unreleased)"
8 .SH NAME
9 /proc/pid/map_files/ \- memory-mapped files
10 .SH DESCRIPTION
11 .TP
12 .IR /proc/ pid /map_files/ " (since Linux 3.3)"
13 .\" commit 640708a2cff7f81e246243b0073c66e6ece7e53e
14 This subdirectory contains entries corresponding to memory-mapped
15 files (see
16 .BR mmap (2)).
17 Entries are named by memory region start and end
18 address pair (expressed as hexadecimal numbers),
19 and are symbolic links to the mapped files themselves.
20 Here is an example,
21 with the output wrapped and reformatted to fit on an 80-column display:
22 .IP
23 .in +4n
24 .EX
25 .RB "#" " ls \-l /proc/self/map_files/"
26 lr\-\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:31
27             3252e00000\-3252e20000 \-> /usr/lib64/ld\-2.15.so
28 \&...
29 .EE
30 .in
31 .IP
32 Although these entries are present for memory regions that were
33 mapped with the
34 .B MAP_FILE
35 flag, the way anonymous shared memory (regions created with the
36 .B MAP_ANON | MAP_SHARED
37 flags)
38 is implemented in Linux
39 means that such regions also appear on this directory.
40 Here is an example where the target file is the deleted
41 .I /dev/zero
42 one:
43 .IP
44 .in +4n
45 .EX
46 lrw\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:33
47             7fc075d2f000\-7fc075e6f000 \-> /dev/zero (deleted)
48 .EE
49 .in
50 .IP
51 Permission to access this file is governed by a ptrace access mode
52 .B PTRACE_MODE_READ_FSCREDS
53 check; see
54 .BR ptrace (2).
55 .IP
56 Until Linux 4.3,
57 .\" commit bdb4d100afe9818aebd1d98ced575c5ef143456c
58 this directory appeared only if the
59 .B CONFIG_CHECKPOINT_RESTORE
60 kernel configuration option was enabled.
61 .IP
62 Capabilities are required to read the contents of the symbolic links in
63 this directory: before Linux 5.9, the reading process requires
64 .B CAP_SYS_ADMIN
65 in the initial user namespace;
66 since Linux 5.9, the reading process must have either
67 .B CAP_SYS_ADMIN
69 .B CAP_CHECKPOINT_RESTORE
70 in the initial (i.e. root) user namespace.
71 .SH SEE ALSO
72 .BR proc (5)