This patch adds a basic manual page for gethugepagesizes(). Signed-off-by: Mel Gorman <[EMAIL PROTECTED]> --- Makefile | 2 +- man/gethugepagesizes.3 | 69 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletions(-) create mode 100644 man/gethugepagesizes.3
diff --git a/Makefile b/Makefile index 66ce145..f723208 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ INSTALL_OBJ_LIBS = libhugetlbfs.so libhugetlbfs.a BIN_OBJ_DIR=obj INSTALL_BIN = hugectl hugeedit hpoolcfg pagesize INSTALL_HEADERS = hugetlbfs.h -INSTALL_MAN3 = get_huge_pages.3 +INSTALL_MAN3 = get_huge_pages.3 gethugepagesizes.3 INSTALL_MAN7 = libhugetlbfs.7 INSTALL_MAN8 = hugectl.8 hugeedit.8 LDSCRIPT_TYPES = B BDT diff --git a/man/gethugepagesizes.3 b/man/gethugepagesizes.3 new file mode 100644 index 0000000..02442a9 --- /dev/null +++ b/man/gethugepagesizes.3 @@ -0,0 +1,69 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH GETHUGEPAGESIZES 3 "October 10, 2008" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp <n> insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +gethugepagesizes - Get the system supported huge page sizes +.SH SYNOPSIS +.B #include <hugetlbfs.h> +.br + +.br +int gethugepagesizes(long pagesizes[], int n_elem); + +.SH DESCRIPTION + +The gethugepagesizes() function returns either the number of system supported +huge page sizes or the sizes themselves. If \fBpagesizes\fP is NULL and +\fBn_elem\fP is 0, then the number of huge pages the system supports is +returned. Otherwise, \fBpagesizes\fP is filled with at most \fBn_elem\fP +page sizes. + +.SH RETURN VALUE + +On success, either the number of huge page sizes supported by the system or +the number of huge page sizes stored in pagesizes is returned. On failure, +-1 is returned and errno is set appropriately. + +.SH ERRORS + +.TP +.B ERRNO +\fBn_elem\fP is less than zero or \fBn_elem\fP is greater than zero and +\fBpagesizes\fP is NULL. + +.PP + +Also see opendir(3) for other possible values for errno. This error occurs +when the sysfs directory exists but cannot be opened. + +.SH NOTES + +This call will return all huge page sizes as reported by the kernel. +Not all of these sizes may be usable by the programmer since mount points +may not be available for all sizes. To test whether a size will be usable +by \fBlibhugetlbfs\fP, hugetlbfs_find_path_for_size() can be called on a +specific size to see if a mount point is configured. + +.SH SEE ALSO +.I oprofile(1), +.I opendir(3), +.I libhugetlbfs(7) + +.SH AUTHORS +libhugetlbfs was written by various people on the libhugetlbfs-devel +mailing list. + -- 1.5.6.5 ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Libhugetlbfs-devel mailing list Libhugetlbfs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel