man pages section 3: Basic Library Functions

Exit Print View

Updated: July 2014
 
 

getpagesize(3C)

Name

getpagesize - get system page size

Synopsis

#include <unistd.h>

int getpagesize(void);

Description

The getpagesize() function returns the number of bytes in a page. Page granularity is the granularity of many of the memory management calls.

The page size is a system page size and need not be the same as the underlying hardware page size.

The getpagesize() function is equivalent to sysconf(_SC_PAGE_SIZE) and sysconf(_SC_PAGESIZE). See sysconf(3C).

Return Values

The getpagesize() function returns the current page size.

Errors

No errors are defined.

Usage

The value returned by getpagesize() need not be the minimum value that malloc(3C) can allocate. Moreover, the application cannot assume that an object of this size can be allocated with malloc().

Attributes

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

ATTRIBUTE TYPE
ATTRIBUTE VALUE
MT-Level
MT-Safe

See also

pagesize(1), brk(2), getrlimit(2), mmap(2), mprotect(2), munmap(2), malloc(3C), msync(3C), sysconf(3C), attributes(5)