Git v1.6.6-rc0
[gitweb.git] / compat / mingw.c
index 34ee427bafad4f964def8e503ebcb15c266eb320..15fe33eaa0f220e94131006bca89effd14d6d058 100644 (file)
@@ -3,6 +3,8 @@
 #include <conio.h>
 #include "../strbuf.h"
 
+#include <shellapi.h>
+
 static int err_win_to_posix(DWORD winerr)
 {
        int error = ENOSYS;
@@ -998,6 +1000,18 @@ int mingw_rename(const char *pold, const char *pnew)
        return -1;
 }
 
+/*
+ * Note that this doesn't return the actual pagesize, but
+ * the allocation granularity. If future Windows specific git code
+ * needs the real getpagesize function, we need to find another solution.
+ */
+int mingw_getpagesize(void)
+{
+       SYSTEM_INFO si;
+       GetSystemInfo(&si);
+       return si.dwAllocationGranularity;
+}
+
 struct passwd *getpwuid(int uid)
 {
        static char user_name[100];