Both in general and with regard to cross-platform support, is one function -- getpagesize() vs. sysconf(_SC_PAGESIZE) -- more reliable than the other?
Asked
Active
Viewed 2,643 times
1 Answers
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