getpagesizes3
Get system page sizes
Usage
#include <sys/mman.h>
int
getpagesizes(size_t pagesize[], int nelem);
Library
Standard C Library (libc, -lc)
Overview
The getpagesizes() function retrieves page size information from the system. When it is called with pagesize specified as NULL and nelem specified as 0, it returns the number of distinct page sizes that are supported by the system. Otherwise, it assigns up to nelem of the system-supported page sizes to consecutive elements of the array referenced by pagesize. These page sizes are expressed in bytes. In this case, getpagesizes() returns the number of such page sizes that it assigned to the array.
Return values
If successful, the getpagesizes() function returns either the number of page sizes that are supported by the system or the number of supported page sizes that it assigned to the array referenced by pagesize. Otherwise, it returns the value -1 and sets errno to indicate the error.
Errors
The getpagesizes() function will succeed unless:
- [EINVAL]
-
The pagesize argument is NULL and the nelem argument is non-zero.
- [EINVAL]
-
The nelem argument is less than zero.
Releases
40 releases since FreeBSD 7.3-RELEASE; the text changed 26 times.