mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 17:24:12 +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
|
#ifndef MAP_NOSYNC
|
||||||
#define MAP_NOSYNC 0
|
#define MAP_NOSYNC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MAP_FIXED_NOREPLACE
|
||||||
|
#define MAP_FIXED_NOREPLACE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
map->address = mmap(
|
map->address = mmap(
|
||||||
@ -1742,12 +1746,7 @@ retry_mapview:;
|
|||||||
if (ptr == MAP_FAILED) {
|
if (ptr == MAP_FAILED) {
|
||||||
/* Try to mmap additional space beyond the end of mapping. */
|
/* Try to mmap additional space beyond the end of mapping. */
|
||||||
ptr = mmap(map->dxb + map->limit, limit - map->limit, mmap_prot,
|
ptr = mmap(map->dxb + map->limit, limit - map->limit, mmap_prot,
|
||||||
mmap_flags
|
mmap_flags | MAP_FIXED_NOREPLACE, map->fd, map->limit);
|
||||||
#if defined(MAP_FIXED_NOREPLACE)
|
|
||||||
| MAP_FIXED_NOREPLACE
|
|
||||||
#endif /* MAP_FIXED_NOREPLACE */
|
|
||||||
,
|
|
||||||
map->fd, map->limit);
|
|
||||||
if (ptr == map->dxb + map->limit)
|
if (ptr == map->dxb + map->limit)
|
||||||
ptr = map->dxb;
|
ptr = map->dxb;
|
||||||
else if (ptr != MAP_FAILED) {
|
else if (ptr != MAP_FAILED) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user