summaryrefslogtreecommitdiff
path: root/src/map.h
diff options
context:
space:
mode:
authorVicent Martí <tanoku@gmail.com>2012-03-14 17:41:04 -0700
committerVicent Martí <tanoku@gmail.com>2012-03-14 17:41:04 -0700
commite24fbba94862fdb602846771f2ae41ef15834d10 (patch)
tree4b11910d7d315a6db667cc4af4c6749630612ed3 /src/map.h
parentdda708e78f3c3f43d814d46c29ab9f2b9d47ed5c (diff)
parentdeafee7bd7a9e2efcdff90627b6094d8c1519319 (diff)
downloadlibgit2-e24fbba94862fdb602846771f2ae41ef15834d10.tar.gz
Merge pull request #595 from arrbee/new-errors-odb
Update odb code to new error handling
Diffstat (limited to 'src/map.h')
-rw-r--r--src/map.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/map.h b/src/map.h
index 0b070fa15..96d879547 100644
--- a/src/map.h
+++ b/src/map.h
@@ -31,6 +31,11 @@ typedef struct { /* memory mapped buffer */
#endif
} git_map;
+#define GIT_MMAP_VALIDATE(out, len, prot, flags) do { \
+ assert(out != NULL && len > 0); \
+ assert((prot & GIT_PROT_WRITE) || (prot & GIT_PROT_READ)); \
+ assert((flags & GIT_MAP_FIXED) == 0); } while (0)
+
extern int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offset);
extern int p_munmap(git_map *map);