Add support for getpagesize

This commit is contained in:
kinichiro
2017-03-15 21:02:22 +09:00
parent 8877e9bc55
commit c61c9821e8
6 changed files with 33 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
/* $OpenBSD$ */
#include <unistd.h>
#ifdef _MSC_VER
#include <windows.h>
#endif
int
getpagesize(void) {
#ifdef _MSC_VER
SYSTEM_INFO system_info;
GetSystemInfo(&system_info);
return system_info.dwPageSize;
#else
return sysconf(_SC_PAGESIZE);
#endif
}