path: root/compat/mingw.h
diff options
authorRené Scharfe <>2010-05-20 18:57:53 (GMT)
committerJunio C Hamano <>2010-05-20 23:12:13 (GMT)
commitc8b296450e5148c576697ea4709072b7855aacd5 (patch)
tree447e36e197bcccdc6fd2f16b59b4742fcfaf2d8d /compat/mingw.h
parentfc012c2810c237dd2299a3fc85b18c2beb60b730 (diff)
Fix checkout of large files to network shares on Windows XP
Bigger writes to network drives on Windows XP fail. Cap them at 31MB to allow them to succeed. Callers need to be prepared for write() calls that do less work than requested anyway. On local drives, write() calls are translated to WriteFile() calls with a cap of 64KB on Windows XP and 256KB on Vista. Thus a cap of 31MB won't affect the number of WriteFile() calls which do the actual work. There's still room for some other version of Windows to use a chunk size of 1MB without increasing the number of system calls. Signed-off-by: Rene Scharfe <> Signed-off-by: Johannes Sixt <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'compat/mingw.h')
1 files changed, 3 insertions, 0 deletions
diff --git a/compat/mingw.h b/compat/mingw.h
index 7c2ab64..0e3e743 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -170,6 +170,9 @@ int link(const char *oldpath, const char *newpath);
int mingw_open (const char *filename, int oflags, ...);
#define open mingw_open
+ssize_t mingw_write(int fd, const void *buf, size_t count);
+#define write mingw_write
FILE *mingw_fopen (const char *filename, const char *otype);
#define fopen mingw_fopen