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