posix_fadvise.2: One can use open(2) + mmap(2) + mincore(2) as a 'fincore'

Note that open(2) + mmap(2) + mincore(2) to get a view of which
pages of a file are currently cached.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-01-26 16:10:44 +13:00
parent 38ca12203c
commit ba759b3c39
1 changed files with 7 additions and 0 deletions

View File

@ -178,6 +178,13 @@ The contents of the kernel buffer cache can be cleared via the
.IR /proc/sys/vm/drop_caches
interface described in
.BR proc (5).
One can obtain a snapshot of which pages of a file are resident
in the buffer cache by opening a file, mapping it with
.BR mmap (2),
and then applying
.BR mincore (2)
to the mapping.
.SS C library/kernel differences
The name of the wrapper function in the C library is
.BR posix_fadvise ().