7

Both in general and with regard to cross-platform support, is one function -- getpagesize() vs. sysconf(_SC_PAGESIZE) -- more reliable than the other?

IntellectualKitty
  • 523
  • 1
  • 6
  • 12

1 Answers1

7

After some additional searching, I've discovered that getpagesize() was deprecated in POSIX issue 6, and removed in POSIX issue 7. It's recommended to use sysconf(_SC_PAGESIZE) instead.

Braiam
  • 1
  • 11
  • 47
  • 78
IntellectualKitty
  • 523
  • 1
  • 6
  • 12
  • Thanks! This is also what `man getpagesize` says: "_In SUSv2 the getpagesize() call is labeled LEGACY, and in POSIX.1-2001 it has been dropped_" and: "_Portable applications should employ sysconf(_SC_PAGESIZE) instead of getpagesize()_" – adentinger Mar 23 '23 at 19:52