mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:14:14 +08:00
mdbx-posix: minor around MAP_FIXED_NOREPLACE
.
Change-Id: I0991a5ed1e1706442675d9514932fad30de372f8
This commit is contained in:
parent
0fd90de97e
commit
0be7616521
11
src/osal.c
11
src/osal.c
@ -1464,6 +1464,10 @@ MDBX_INTERNAL_FUNC int mdbx_mmap(const int flags, mdbx_mmap_t *map,
|
||||
|
||||
#ifndef MAP_NOSYNC
|
||||
#define MAP_NOSYNC 0
|
||||
#endif
|
||||
|
||||
#ifndef MAP_FIXED_NOREPLACE
|
||||
#define MAP_FIXED_NOREPLACE 0
|
||||
#endif
|
||||
|
||||
map->address = mmap(
|
||||
@ -1742,12 +1746,7 @@ retry_mapview:;
|
||||
if (ptr == MAP_FAILED) {
|
||||
/* Try to mmap additional space beyond the end of mapping. */
|
||||
ptr = mmap(map->dxb + map->limit, limit - map->limit, mmap_prot,
|
||||
mmap_flags
|
||||
#if defined(MAP_FIXED_NOREPLACE)
|
||||
| MAP_FIXED_NOREPLACE
|
||||
#endif /* MAP_FIXED_NOREPLACE */
|
||||
,
|
||||
map->fd, map->limit);
|
||||
mmap_flags | MAP_FIXED_NOREPLACE, map->fd, map->limit);
|
||||
if (ptr == map->dxb + map->limit)
|
||||
ptr = map->dxb;
|
||||
else if (ptr != MAP_FAILED) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user