29 #include <sys/types.h>
44 #include "debug_lock.h"
45 #include "shm_arena.h"
47 #include "arena_lock.h"
56 int _shm_arena_sync_mappings( IF_SPEW(
const char *func,)
60 int mapping_changed = 0;
65 SPEW(_DEBUG,
"%s(from func=\"%s\",,)", __func__, func);
72 return SPEW_SYS_RET(1, _WARN,
73 "There are no mappings in the arena file");
86 return SPEW_SYS_RET(1, _WARN,
"%s() failed: "
87 "munmap() failed: mapping %d", func, i);
96 return SPEW_SYS_RET(1, _WARN,
"%s() failed: realloc() failed",
115 return SPEW_SYS_RET(1, _WARN,
116 "%s() failed: mumap() failed: remapping %d",
121 PROT_READ|PROT_WRITE, MAP_SHARED, arena->
fd, offset);
123 return SPEW_SYS_RET(1, _WARN,
124 "%s() failed: mmap() failed: remapping %d",
128 return SPEW_SYS_RET(1, _WARN,
"%s() failed: mmap() failed"
129 " with SHM_ADDRESS set: remapping %d",
141 map_header = get_mapping_header(arena, 1);
150 void *map_start = NULL;
154 return SPEW_SYS_RET(1, _WARN,
155 "%s() failed: mumap() failed: remapping %d",
161 map_start = (
void*)(((uintptr_t) arena->
mapping[i-1].
start) +
165 PROT_READ|PROT_WRITE, MAP_SHARED, arena->
fd, offset);
167 return SPEW_SYS_RET(1, _WARN,
168 "%s() failed: mmap() failed:"
169 " remapping %d", func, i);
171 return SPEW_SYS_RET(1, _WARN,
172 "%s() failed: mmap() failed with SHM_ADDRESS set:"
173 " remapping %d", func, i);
178 map_header = get_mapping_header(arena, i);
struct arena_header * header
struct shm_mapping * mapping