summaryrefslogtreecommitdiff
path: root/src/win32/mmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/win32/mmap.c')
-rw-r--r--src/win32/mmap.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/win32/mmap.c b/src/win32/mmap.c
index d702a78..8bddb50 100644
--- a/src/win32/mmap.c
+++ b/src/win32/mmap.c
@@ -1,38 +1,39 @@
-#include <string.h>
-#include <sys/types.h>
+#include <stdint.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
+#include <sys/types.h>
#include "mmap.h"
-void *mmap (void *addr, size_t len, int prot, int flags, int fd, long long offset) {
+void *mmap (void *addr, uint32_t len, int32_t prot, int32_t flags, int32_t fd, int64_t offset) {
void *buf;
ssize_t count;
- if ( addr || fd == -1 || (prot & PROT_WRITE)) { return(MAP_FAILED); }
+ if ( addr || fd == -1 || (prot & PROT_WRITE)) { return (MAP_FAILED); }
buf = malloc(len);
- if ( NULL == buf ) { return(MAP_FAILED); }
+ if ( NULL == buf ) { return (MAP_FAILED); }
if (lseek(fd, offset, SEEK_SET) != offset) {
free(buf);
- return(MAP_FAILED);
+ return (MAP_FAILED);
}
count = read(fd, buf, len);
if (count != (ssize_t)len) {
free (buf);
- return(MAP_FAILED);
+ return (MAP_FAILED);
}
- return(buf);
+ return (buf);
(void)flags;
}
-int munmap (void *addr, size_t len) {
+int32_t munmap (void *addr, uint32_t len) {
free (addr);
- return(0);
+ return (0);
(void)len;
}