| 1 |
.\" Hey, EMACS: -*- nroff -*- |
| 2 |
.\" First parameter, NAME, should be all caps |
| 3 |
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection |
| 4 |
.\" other parameters are allowed: see man(7), man(1) |
| 5 |
.TH GETPAGESIZES 3 "October 10, 2008" |
| 6 |
.\" Please adjust this date whenever revising the manpage. |
| 7 |
.\" |
| 8 |
.\" Some roff macros, for reference: |
| 9 |
.\" .nh disable hyphenation |
| 10 |
.\" .hy enable hyphenation |
| 11 |
.\" .ad l left justify |
| 12 |
.\" .ad b justify to both left and right margins |
| 13 |
.\" .nf disable filling |
| 14 |
.\" .fi enable filling |
| 15 |
.\" .br insert line break |
| 16 |
.\" .sp <n> insert n+1 empty lines |
| 17 |
.\" for manpage-specific macros, see man(7) |
| 18 |
.SH NAME |
| 19 |
getpagesizes - Get the system supported huge page sizes |
| 20 |
.SH SYNOPSIS |
| 21 |
.B #include <hugetlbfs.h> |
| 22 |
.br |
| 23 |
|
| 24 |
.br |
| 25 |
int getpagesizes(long pagesizes[], int n_elem); |
| 26 |
|
| 27 |
.SH DESCRIPTION |
| 28 |
|
| 29 |
The getpagesizes() function returns either the number of system supported |
| 30 |
page sizes or the sizes themselves. If \fBpagesizes\fP is NULL and |
| 31 |
\fBn_elem\fP is 0, then the number of pages the system supports is |
| 32 |
returned. Otherwise, \fBpagesizes\fP is filled with at most \fBn_elem\fP |
| 33 |
page sizes. |
| 34 |
|
| 35 |
.SH RETURN VALUE |
| 36 |
|
| 37 |
On success, either the number of page sizes supported by the system or the |
| 38 |
number of page sizes stored in \fBpagesizes\fP is returned. On failure, |
| 39 |
-1 is returned and errno is set appropriately. |
| 40 |
|
| 41 |
.SH ERRORS |
| 42 |
|
| 43 |
.TP |
| 44 |
.B EINVAL |
| 45 |
\fBn_elem\fP is less than zero or \fBn_elem\fP is greater than zero and |
| 46 |
\fBpagesizes\fP is NULL. |
| 47 |
|
| 48 |
.PP |
| 49 |
|
| 50 |
Also see opendir(3) for other possible values for errno. This error occurs |
| 51 |
when the sysfs directory exists but cannot be opened. |
| 52 |
|
| 53 |
.SH NOTES |
| 54 |
|
| 55 |
This call will return all page sizes as reported by the kernel. Not all of |
| 56 |
these sizes may be usable by the programmer since mount points may not be |
| 57 |
available for the huge page sizes. To test whether a size will be usable |
| 58 |
by \fBlibhugetlbfs\fP, hugetlbfs_find_path_for_size() can be called on a |
| 59 |
specific size to see if a mount point is configured. |
| 60 |
|
| 61 |
.SH SEE ALSO |
| 62 |
.I oprofile(1), |
| 63 |
.I opendir(3), |
| 64 |
.I gethugepagesizes(3), |
| 65 |
.I libhugetlbfs(7) |
| 66 |
|
| 67 |
.SH AUTHORS |
| 68 |
libhugetlbfs was written by various people on the libhugetlbfs-devel |
| 69 |
mailing list. |
| 70 |
|