On Thu, 2008-11-06 at 16:20 +0000, Mel Gorman wrote: > +.SH NAME > +hugetlbfs_unlinked_fd, hugetlbfs_unlinked_fd_for_size \- Open an unlinked > file on a hugetlbfs filesystem > +.SH SYNOPSIS > +.B #include <hugetlbfs.h> > +.br > + > +.br > +.B int hugetlbfs_unlinked_fd(void); > +.br > +.B hugetlbfs_unlinked_fd_for_size(long page_size); > +.SH DESCRIPTION > + > +\fBhugetlbfs_unlinked_fd()\fB and its page-size-aware companion > +\fBhugetlbfs_unlinked_fd_for_size()\fB discover a suitable hugetlbfs mount > +point, open a file, unlink it and return the descriptor. This is mainly used > +interally by hugetlbfs to create memory regions with map(). An example usage > +might be to create a heap by allocating and unlinked filedescriptor and using > +mmap() and munmap to grow and shrink the heap respectively. > + > +.SH RETURN VALUE > + > +Both functions return a valid file descriptor on success and -1 on failure. > +errno is not necessarily set to anything useful when an error occurs. > + > +.SH NOTES > + > +In the current version of libhugetlbfs, it is difficult to programatically > +determine why an unlinked file could not be created. It will depend on the > +user reading messages writting to console to diagnose and correct the error.
I think it might be useful to describe in the man page why an _unlinked_ file descriptor is desired. This isn't immediately obvious. Saying that it makes the fd behave more like anonymous memory (in that the huge pages are freed after an unmap and the data will not persist) and that another process cannot open the same fd to snoop data. Otherwise these all look good. > +.SH SEE ALSO > +.I oprofile(1) > +, > +.I libhugetlbfs(7) > +.SH AUTHORS > +libhugetlbfs was written by various people on the libhugetlbfs-devel > +mailing list. -- Adam Litke - (agl at us.ibm.com) IBM Linux Technology Center ------------------------------------------------------------------------- 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