diff --git a/std/os/system_linux.spice b/std/os/system_linux.spice index 86bef54f2..40198a85c 100644 --- a/std/os/system_linux.spice +++ b/std/os/system_linux.spice @@ -1,5 +1,6 @@ // External functions ext f get_nprocs(); +ext f getpagesize(); /** * Returns the number of CPU cores of the host system. @@ -8,4 +9,13 @@ ext f get_nprocs(); */ public f getCPUCoreCount() { return get_nprocs(); +} + +/** + * Returns the system page size of the host system. + * + * return Page size + */ +public f getPageSize() { + return getpagesize(); } \ No newline at end of file diff --git a/std/os/system_windows.spice b/std/os/system_windows.spice index 45aff7605..28eec88a3 100644 --- a/std/os/system_windows.spice +++ b/std/os/system_windows.spice @@ -11,8 +11,8 @@ type SystemInfo struct { unsigned short wProcessorArchitecture unsigned short wReserved unsigned int dwPageSize - long* lpMinimumApplicationAddress - long* lpMaximumApplicationAddress + byte* lpMinimumApplicationAddress + byte* lpMaximumApplicationAddress int* dwActiveProcessorMask unsigned int dwNumberOfProcessors int dwProcessorType @@ -62,4 +62,15 @@ public f getArchName() { return "intel"; } return "unknown"; +} + +/** + * Returns the system page size of the host system. + * + * return Page size + */ +public f getPageSize() { + SystemInfo info = SystemInfo{}; + GetSystemInfo(&info); + return info.dwPageSize; } \ No newline at end of file