diff --git a/include/map.h b/include/map.h index 847b455..13a3545 100644 --- a/include/map.h +++ b/include/map.h @@ -37,6 +37,7 @@ int map_advise_rand(mmap_t* restrict ptr, int need); typedef void* (*map_cb)(mmap_t map, void* user); void* map_and_then(const char* file, map_cb callback, void* user); void* map_fd_and_then(int fd, map_cb callback, void* user); +int unmap_and_close_s(mmap_t map, int flags); #ifdef __cplusplus } diff --git a/src/map.c b/src/map.c index f74f004..34638a4 100644 --- a/src/map.c +++ b/src/map.c @@ -113,6 +113,7 @@ int open_and_alloc(const char* file, mmap_t* restrict ptr, size_t sz) return 1; } + inline int unmap_and_close_s(mmap_t map, int flags) {