Use getpagesize(3) under FreeBSD.
This avoids sysctl(2) syscall during binary startup, using the value passed in the ELF aux vector instead. Signed-off-by: Edward Tomasz Napierala <trasz@FreeBSD.org>
This commit is contained in:
parent
58eba024c0
commit
d591df05c8
@ -357,6 +357,8 @@ os_page_detect(void) {
|
|||||||
SYSTEM_INFO si;
|
SYSTEM_INFO si;
|
||||||
GetSystemInfo(&si);
|
GetSystemInfo(&si);
|
||||||
return si.dwPageSize;
|
return si.dwPageSize;
|
||||||
|
#elif defined(__FreeBSD__)
|
||||||
|
return getpagesize();
|
||||||
#else
|
#else
|
||||||
long result = sysconf(_SC_PAGESIZE);
|
long result = sysconf(_SC_PAGESIZE);
|
||||||
if (result == -1) {
|
if (result == -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user