libowfat/mmap/mmap_unmap.c

19 lines
321 B
C
Raw Normal View History

2006-05-18 06:13:49 +00:00
#include <sys/types.h>
#include <unistd.h>
#ifdef __MINGW32__
#include <windows.h>
#else
#include <sys/mman.h>
#endif
#include "open.h"
#include "mmap.h"
2006-11-07 17:56:05 +00:00
int mmap_unmap(char* mapped,size_t maplen) {
2006-05-18 06:13:49 +00:00
#ifdef __MINGW32__
(void)maplen;
return UnmapViewOfFile(mapped)?0:-1;
#else
return munmap(mapped,maplen);
#endif
}