xref: /illumos-gate/usr/src/man/man3c/getpagesizes.3c (revision 6bb6b5762ca4b17cd5fb3c6c123f17489d5635aa)
te
Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
GETPAGESIZES 3C "May 14, 2001"
NAME
getpagesizes - get system supported page sizes
SYNOPSIS

#include <sys/mman.h>

int getpagesizes(size_t pagesize[\|], int nelem);
DESCRIPTION

The getpagesizes() function returns either the number of different page sizes supported by the system or the actual sizes themselves. When called with nelem as 0 and pagesize as NULL, getpagesizes() returns the number of supported page sizes. Otherwise, up to nelem page sizes are retrieved and assigned to successive elements of pagesize[\|]. The return value is the number of page sizes retrieved and set in pagesize[\|].

RETURN VALUES

Upon successful completion, the number of pagesizes supported or actually retrieved is returned. Otherwise, -1 is returned and errno is set to indicate the error.

ERRORS

The getpagesizes() function will fail if: EINVAL

The nelem argument is less than 0 or pagesize is NULL but nelem is non-zero.

USAGE

The getpagesizes() function returns all the page sizes for which the hardware and system software provide support for the memcntl(2) command MC_HAT_ADVISE. Not all processors support all page sizes or combinations of page sizes with equal efficiency. Applications programmers should take this into consideration when using getpagesizes().

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
MT-Level MT-Safe
SEE ALSO

memcntl(2), mmap(2), getpagesize(3C), attributes(5)