summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorStefan-W. Hahn <stefan.hahn@s-hahn.de>2007-01-09 21:04:12 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-01-10 00:40:40 (GMT)
commit6900679c2f6d937a5a6ef616869c8887690ad19d (patch)
tree138e2f17ba6cd89646c5098ce526e51a4dce5359 /git-compat-util.h
parent0bdb28c9ccd85b1c606664154b6f6d39a4c315fd (diff)
downloadgit-6900679c2f6d937a5a6ef616869c8887690ad19d.zip
git-6900679c2f6d937a5a6ef616869c8887690ad19d.tar.gz
git-6900679c2f6d937a5a6ef616869c8887690ad19d.tar.bz2
Replacing the system call pread() with lseek()/xread()/lseek() sequence.
Using cygwin with cygwin.dll before 1.5.22 the system call pread() is buggy. This patch introduces NO_PREAD. If NO_PREAD is set git uses a sequence of lseek()/xread()/lseek() to emulate pread. Signed-off-by: Stefan-W. Hahn <stefan.hahn@s-hahn.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index e023bf1..f8d46d5 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -107,6 +107,11 @@ extern int git_munmap(void *start, size_t length);
#define DEFAULT_PACKED_GIT_LIMIT \
((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
+#ifdef NO_PREAD
+#define pread git_pread
+extern ssize_t git_pread(int fd, void *buf, size_t count, off_t offset);
+#endif
+
#ifdef NO_SETENV
#define setenv gitsetenv
extern int gitsetenv(const char *, const char *, int);