add mmap_unmap
This commit is contained in:
18
mmap/mmap_unmap.c
Normal file
18
mmap/mmap_unmap.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#ifdef __MINGW32__
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
#include "open.h"
|
||||
#include "mmap.h"
|
||||
|
||||
int mmap_unmap(char* mapped,unsigned long maplen) {
|
||||
#ifdef __MINGW32__
|
||||
(void)maplen;
|
||||
return UnmapViewOfFile(mapped)?0:-1;
|
||||
#else
|
||||
return munmap(mapped,maplen);
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user