mincore(2)mincore(2)NAMEmincore() - determine residency of memory pages
SYNOPSISDESCRIPTION
The function determines the residency of the memory pages specified by
the range [addr, addr+len]. The status is returned as a character-per-
page in the character array referenced by vec. The least significant
bit of each character is set to 1 to indicate the referenced page is in
memory and to 0 to indicate that it is not. The settings of other bits
in each character are undefined and may contain other information about
a page in future implementations.
This system call returns the status of all memory pages within the
range, addr to addr+len. The addr parameter is automatically rounded
down to the nearest page size as returned by system call. If the len
value is not a multiple of the page size as returned by the system
call, the end of the range is rounded up to the next multiple of the
page size.
The vector vec must be large enough to contain one byte per memory page
within the address range.
Warnings
Because the status of a page can change between the time checks and
returns the information, returned information might be outdated. Only
locked pages are guaranteed to remain in memory. See mlock(2).
RETURN VALUE
Upon successful completion, returns Otherwise, it returns and sets to
indicate the error.
ERRORS
The function will fail if:
The vec argument points to an illegal address or an
address for which the caller does not have write
mode access.
len argument has a value less than or equal to 0.
Addresses in the range
[addr, addr+len] span beyond the address space of
a 64-bit process.
Addresses in the range
[addr, addr+len] are invalid or not mapped for
the address space of a process.
SEE ALSOmmap(2), mlock(2), plock(2), sysconf(2), <sys/mman.h>.
mincore(2)