Restore a FreeBSD-specific getpagesize(3) optimization.

It was removed in 0771ff2cea.
Add a comment explaining its purpose.
This commit is contained in:
Edward Tomasz Napierala 2018-10-25 16:06:42 +01:00 committed by Qi Wang
parent cd2931ad9b
commit a4c6b9ae01

View File

@ -419,6 +419,12 @@ os_page_detect(void) {
SYSTEM_INFO si; SYSTEM_INFO si;
GetSystemInfo(&si); GetSystemInfo(&si);
return si.dwPageSize; return si.dwPageSize;
#elif defined(__FreeBSD__)
/*
* This returns the value obtained from
* the auxv vector, avoiding a syscall.
*/
return getpagesize();
#else #else
long result = sysconf(_SC_PAGESIZE); long result = sysconf(_SC_PAGESIZE);
if (result == -1) { if (result == -1) {