]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Windows port: Return the effective system pagesize in getpagesize()
authorGuido Serassio <serassio@squid-cache.org>
Thu, 1 May 2008 16:05:05 +0000 (18:05 +0200)
committerGuido Serassio <serassio@squid-cache.org>
Thu, 1 May 2008 16:05:05 +0000 (18:05 +0200)
lib/win32lib.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 34df133..58b130d
@@ -63,7 +63,13 @@ void GetProcessName(pid_t, char *);
 size_t 
 getpagesize()
 {
-    return 4096;
+    static DWORD system_pagesize = 0;
+    if (!system_pagesize) {
+       SYSTEM_INFO system_info;
+       GetSystemInfo(&system_info);
+       system_pagesize = system_info.dwPageSize;
+    }
+    return system_pagesize;
 }
 #endif