mincore(2) - Linux man page
Name
mincore - get information on whether pages are in coreSynopsis
#include <unistd.h>#include <sys/mman.h>
int mincore(void *start, size_t length, unsigned char *vec);
Description
For mincore() to return successfully, start must lie on a page boundary. It is the caller's responsibility to round up to the nearest page. The length parameter need not be a multiple of the page size. The vector vec must be large enough to contain (length+PAGE_SIZE-1) / PAGE_SIZE bytes. One may obtain the page size from getpagesize(2).
Return Value
On success, mincore() returns zero. On error, -1 is returned, and errno is set appropriately.Errors
EAGAIN kernel is temporarily out of resources- EFAULT
- vec points to an invalid address
- EINVAL
- start is not a multiple of the page size.
- ENOMEM
- len is greater than (TASK_SIZE - start). (This could occur if a negative value is specified for len, since that value will be interpreted as a large unsigned integer.) In Linux 2.6.11 and earlier, the error EINVAL was returned for this condition.
- ENOMEM
- address to address + length contained unmapped memory, or memory not part of a file.
