GETHUGEPAGESIZE(3)

πŸ’– GETHUGEPAGESIZE(3) πŸ’–

okay bestie, so this one is from the Library Functions Manual and it's literally just a little guy that tells you how big your huge pages are 🫢


✨ NAME ✨

gethugepagesize β€” get the default huge page size, no cap


🌸 SYNOPSIS 🌸

#include <hugetlbfs.h>

long gethugepagesize(void)

like that's it. that's the whole function. no args. she takes nothing and she gives everything πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the gethugepagesize() function returns the default huge page size used by libhugetlbfs. ✨

and when she says "default", she means either:

  • the system default, OR
  • a valid value set by the environment variable HUGETLB_DEFAULT_PAGE_SIZE πŸ‘‘

so yeah, if you set that env var to something valid, that's what you get back. she's not ignoring your vibe, she's honoring it fr fr.

⚠️ but heads up bestie β€” if the system does not support any huge page sizes, an error is returned. no huge pages, no answer, periodt. πŸ’€

πŸ’œ RETURN VALUE πŸ’œ

  • on success: the default huge page size is returned πŸŽ€ slay
  • on failure: -1 is returned and errno is set appropriately 😭

πŸ”₯ ERRORS πŸ”₯

  • ENOSYS β€” the system does not support huge pages. it's giving "sorry babe, not a thing here" πŸ™ˆ

🌈 SEE ALSO 🌈


πŸ‘‘ AUTHORS πŸ‘‘

libhugetlbfs was written by various people on the libhugetlbfs-devel mailing list. a whole group chat of legends, honestly. main character energy from every single one of them πŸ’–


okay that's the whole page bestie, and just so you have the receipts: this version is from March 7, 2012, sourced from libhugetlbfs. go forth and page size responsibly βœ¨πŸŽ€πŸ¦‹πŸ’