| 1 |
.\" Copyright 1994-1995, Daniel Quinlan <[email protected]> |
| 2 |
.\" Copyright 2002-2017, Michael Kerrisk <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: GPL-3.0-or-later |
| 6 |
.\" |
| 7 |
.TH proc_pid_map_files 5 2026-02-08 "Linux man-pages 6.18" |
| 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; |
| 54 |
see |
| 55 |
.BR ptrace (2). |
| 56 |
.IP |
| 57 |
Until Linux 4.3, |
| 58 |
.\" commit bdb4d100afe9818aebd1d98ced575c5ef143456c |
| 59 |
this directory appeared only if the |
| 60 |
.B CONFIG_CHECKPOINT_RESTORE |
| 61 |
kernel configuration option was enabled. |
| 62 |
.IP |
| 63 |
Capabilities are required to read the contents of the symbolic links in |
| 64 |
this directory: before Linux 5.9, the reading process requires |
| 65 |
.B CAP_SYS_ADMIN |
| 66 |
in the initial user namespace; |
| 67 |
since Linux 5.9, the reading process must have either |
| 68 |
.B CAP_SYS_ADMIN |
| 69 |
or |
| 70 |
.B CAP_CHECKPOINT_RESTORE |
| 71 |
in the initial (i.e., root) user namespace. |
| 72 |
.SH SEE ALSO |
| 73 |
.BR proc (5) |