1 #include "../git-compat-util.h"
3 void *git_mmap(void *start
, size_t length
, int prot
, int flags
, int fd
, off_t offset
)
7 if (start
!= NULL
|| flags
!= MAP_PRIVATE
|| prot
!= PROT_READ
)
8 die("Invalid usage of mmap when built with NO_MMAP");
15 start
= malloc(length
);
22 ssize_t count
= xpread(fd
, (char *)start
+ n
, length
- n
, offset
+ n
);
25 memset((char *)start
+n
, 0, length
-n
);
41 int git_munmap(void *start
, size_t length
)