mincore(2) - NetBSD Manual Pages

Command: Section: Arch: Collection:  
MINCORE(2)                NetBSD System Calls Manual                MINCORE(2)


NAME
mincore -- determine residency of memory pages
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/mman.h> int mincore(void *addr, size_t len, char *vec);
DESCRIPTION
The mincore() system call tells whether the pages covering len bytes of data starting at addr are core resident in the process. The status of the memory range is returned in the character-per-page array vec. If the page is resident, the least significant bit of the corresponding charac- ter in vec will be set. Other bits are reserved for additional informa- tion which future implementations may return. Note that the status of each page may change between the call to mincore() and the return of the page status information. In order to guarantee that pages will remain in core, the address range must be locked with mlock(2).
RETURN VALUES
The mincore() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.
ERRORS
The mincore() call will fail if: [EFAULT] vec points to an illegal address. [EINVAL] addr is not a multiple of the system page size. [EINVAL] len is equal to 0. [ENOMEM] The address range specified is invalid for the calling process, or one or more of the pages specified in the range are not mapped.
SEE ALSO
madvise(2), mlock(2), mprotect(2), msync(2), munmap(2), sysconf(3)
HISTORY
The mincore() function first appeared in 4.4BSD. NetBSD 10.99 June 6, 1999 NetBSD 10.99
Powered by man-cgi (2024-03-20). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.