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

NAME

6       gethugepagesizes - Get the system supported huge page sizes
7

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

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

ERRORS

29       EINVAL n_elem  is  less  than  zero  or n_elem is greater than zero and
30              pagesizes is NULL.
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 huge page sizes as reported by the kernel.
38       Not all of these sizes may be usable  by  the  programmer  since  mount
39       points may not be available for all sizes.  To test whether a size will
40       be usable by libhugetlbfs, hugetlbfs_find_path_for_size() can be called
41       on a specific size to see if a mount point is configured.
42
43

SEE ALSO

45       oprofile(1),    opendir(3),    hugetlbfs_find_path_for_size(3),    lib‐
46       hugetlbfs(7)
47
48

AUTHORS

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