mirror of https://github.com/mkerrisk/man-pages
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:
parent
38ca12203c
commit
ba759b3c39
|
@ -178,6 +178,13 @@ The contents of the kernel buffer cache can be cleared via the
|
||||||
.IR /proc/sys/vm/drop_caches
|
.IR /proc/sys/vm/drop_caches
|
||||||
interface described in
|
interface described in
|
||||||
.BR proc (5).
|
.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
|
.SS C library/kernel differences
|
||||||
The name of the wrapper function in the C library is
|
The name of the wrapper function in the C library is
|
||||||
.BR posix_fadvise ().
|
.BR posix_fadvise ().
|
||||||
|
|
Loading…
Reference in New Issue