Message ID | CACTTzNaPqnf8mZRysHAXgMJXPPzy2XJDv44LRWWn-RmPGOJnfA@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
--- a/src/common/util.c +++ b/src/common/util.c @@ -312,9 +312,14 @@ util_map(int fd, size_t len, int cow, size_t req_align) void *base; void *addr = util_map_hint(len, req_align); + int flags = MAP_PMEM_AWARE; - if ((base = mmap(addr, len, PROT_READ|PROT_WRITE, - (cow) ? MAP_PRIVATE|MAP_NORESERVE : MAP_SHARED, + if (cow) + flags |= MAP_PRIVATE | MAP_NORESERVE; + else + flags |= MAP_SHARED; + + if ((base = mmap(addr, len, PROT_READ|PROT_WRITE, flags, fd, 0)) == MAP_FAILED) { ERR("!mmap %zu bytes", len); return NULL;