Debian Codegraph @

man/gethugepagesizes.3

raw
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 GETHUGEPAGESIZES 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 gethugepagesizes - Get the system supported huge page sizes
20 .SH SYNOPSIS
21 .B #include <hugetlbfs.h>
22
23 .br
24 int gethugepagesizes(long pagesizes[], int n_elem);
25
26 .SH DESCRIPTION
27
28 The gethugepagesizes() function returns either the number of system supported
29 huge page sizes or the sizes themselves. If \fBpagesizes\fP is NULL and
30 \fBn_elem\fP is 0, then the number of huge pages the system supports is
31 returned. Otherwise, \fBpagesizes\fP is filled with at most \fBn_elem\fP
32 page sizes.
33
34 .SH RETURN VALUE
35
36 On success, either the number of huge page sizes supported by the system or
37 the number of huge page sizes stored in pagesizes is returned. On failure,
38 -1 is returned and errno is set appropriately.
39
40 .SH ERRORS
41
42 .TP
43 .B EINVAL
44 \fBn_elem\fP is less than zero or \fBn_elem\fP is greater than zero and
45 \fBpagesizes\fP is NULL.
46 .PP
47 Also see opendir(3) for other possible values for errno. This error occurs
48 when the sysfs directory exists but cannot be opened.
49
50 .SH NOTES
51
52 This call will return all huge page sizes as reported by the kernel.
53 Not all of these sizes may be usable by the programmer since mount points
54 may not be available for all sizes. To test whether a size will be usable
55 by \fBlibhugetlbfs\fP, hugetlbfs_find_path_for_size() can be called on a
56 specific size to see if a mount point is configured.
57
58 .SH SEE ALSO
59 .I oprofile(1),
60 .I opendir(3),
61 .I hugetlbfs_find_path_for_size(3),
62 .I libhugetlbfs(7)
63
64 .SH AUTHORS
65 libhugetlbfs was written by various people on the libhugetlbfs-devel
66 mailing list.