| 126 |
shmid = p_trie_node_pool->shmid; |
shmid = p_trie_node_pool->shmid; |
| 127 |
|
|
| 128 |
// Remap shared memory in read-only mode |
// Remap shared memory in read-only mode |
| 129 |
|
#if defined(__MSYS__) || defined(__MINGW32__) |
| 130 |
|
if (shmdt(p_trie_node_pool) == -1) |
| 131 |
|
{ |
| 132 |
|
log_error("shmdt(trie_node_pool) error (%d)\n", errno); |
| 133 |
|
return -1; |
| 134 |
|
} |
| 135 |
|
p_shm = shmat(shmid, p_trie_node_pool, SHM_RDONLY); |
| 136 |
|
#else |
| 137 |
p_shm = shmat(shmid, p_trie_node_pool, SHM_RDONLY | SHM_REMAP); |
p_shm = shmat(shmid, p_trie_node_pool, SHM_RDONLY | SHM_REMAP); |
| 138 |
|
#endif |
| 139 |
if (p_shm == (void *)-1) |
if (p_shm == (void *)-1) |
| 140 |
{ |
{ |
| 141 |
log_error("shmat(trie_node_pool shmid=%d) error (%d)\n", shmid, errno); |
log_error("shmat(trie_node_pool shmid=%d) error (%d)\n", shmid, errno); |