1GETPAGESIZES(3)            Library Functions Manual            GETPAGESIZES(3)
2
3
4

NAME

6       getpagesizes - Get the system supported huge page sizes
7

SYNOPSIS

9       #include <hugetlbfs.h>
10
11       int getpagesizes(long pagesizes[], int n_elem);
12
13

DESCRIPTION

15       The  getpagesizes()  function  returns either the number of system sup‐
16       ported page sizes or the sizes  themselves. If pagesizes  is  NULL  and
17       n_elem  is 0, then the number of pages the system supports is returned.
18       Otherwise, pagesizes is filled with at most n_elem page sizes.
19
20

RETURN VALUE

22       On success, either the number of page sizes supported by the system  or
23       the  number  of page sizes stored in pagesizes is returned. On failure,
24       -1 is returned and errno is set appropriately.
25
26

ERRORS

28       EINVAL n_elem is less than zero or n_elem  is  greater  than  zero  and
29              pagesizes is NULL.
30
31
32       Also  see  opendir(3)  for  other possible values for errno. This error
33       occurs when the sysfs directory exists but cannot be opened.
34
35

NOTES

37       This call will return all page sizes as reported by  the  kernel.   Not
38       all  of  these sizes may be usable by the programmer since mount points
39       may not be available for the huge page sizes.  To test whether  a  size
40       will  be  usable by libhugetlbfs, hugetlbfs_find_path_for_size() can be
41       called on a specific size to see if a mount point is configured.
42
43

SEE ALSO

45       oprofile(1), opendir(3), gethugepagesizes(3), libhugetlbfs(7)
46
47

AUTHORS

49       libhugetlbfs was written by various people  on  the  libhugetlbfs-devel
50       mailing list.
51
52
53
54
55                               October 10, 2008                GETPAGESIZES(3)
Impressum