Commit 82c23c58 by Chris Young

Assume this is irrelevant for now

parent d0517805
#include "map.h" #include "map.h"
#ifndef __amigaos4__
#include <sys/mman.h> #include <sys/mman.h>
#endif
#include <errno.h> #include <errno.h>
int git__mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offset) int git__mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offset)
{ {
#ifndef __amigaos4__
int mprot = 0; int mprot = 0;
int mflag = 0; int mflag = 0;
...@@ -42,19 +45,20 @@ int git__mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t o ...@@ -42,19 +45,20 @@ int git__mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t o
if (!out->data || out->data == MAP_FAILED) if (!out->data || out->data == MAP_FAILED)
return git__throw(GIT_EOSERR, "Failed to mmap. Could not write data"); return git__throw(GIT_EOSERR, "Failed to mmap. Could not write data");
out->len = len; out->len = len;
#endif
return GIT_SUCCESS; return GIT_SUCCESS;
} }
int git__munmap(git_map *map) int git__munmap(git_map *map)
{ {
#ifndef __amigaos4__
assert(map != NULL); assert(map != NULL);
if (!map) if (!map)
return git__throw(GIT_ERROR, "Failed to munmap. Map does not exist"); return git__throw(GIT_ERROR, "Failed to munmap. Map does not exist");
munmap(map->data, map->len); munmap(map->data, map->len);
#endif
return GIT_SUCCESS; return GIT_SUCCESS;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment