summaryrefslogtreecommitdiff
path: root/src/posix.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-05-13 02:41:48 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-05-17 01:39:43 +0200
commitf7310540ae888454f9ab69200cfcd8df07faf957 (patch)
tree5f44f5b95c7191c1319846a8ef3534f352f8a98d /src/posix.h
parentadebcb1645f7bd652ff4449ecf41c39ded12d0c7 (diff)
downloadlibgit2-f7310540ae888454f9ab69200cfcd8df07faf957.tar.gz
indexer: use mmap for writing
Some OSs cannot keep their ideas about file content straight when mixing standard IO with file mapping. As we use mmap for reading from the packfile, let's make writing to the pack file use mmap.
Diffstat (limited to 'src/posix.h')
-rw-r--r--src/posix.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/posix.h b/src/posix.h
index f85b1aebd..745e4af75 100644
--- a/src/posix.h
+++ b/src/posix.h
@@ -60,6 +60,7 @@ extern int p_write(git_file fd, const void *buf, size_t cnt);
#define p_lseek(f,n,w) lseek(f, n, w)
#define p_close(fd) close(fd)
#define p_umask(m) umask(m)
+#define p_ftruncate(fd, sz) ftruncate(fd, sz)
extern int p_open(const char *path, int flags, ...);
extern int p_creat(const char *path, mode_t mode);