| 174 |
p_line_offsets = p_data + data_len + 1; |
p_line_offsets = p_data + data_len + 1; |
| 175 |
memcpy(p_line_offsets, line_offsets, sizeof(long) * (size_t)(line_total + 1)); |
memcpy(p_line_offsets, line_offsets, sizeof(long) * (size_t)(line_total + 1)); |
| 176 |
|
|
| 177 |
|
// Remap shared memory in read-only mode |
| 178 |
|
p_shm = shmat(shmid, p_shm, SHM_RDONLY | SHM_REMAP); |
| 179 |
|
if (p_shm == (void *)-1) |
| 180 |
|
{ |
| 181 |
|
log_error("shmat(shmid=%d) error (%d)\n", shmid, errno); |
| 182 |
|
return -3; |
| 183 |
|
} |
| 184 |
|
|
| 185 |
if (trie_dict_get(p_trie_file_dict, filename, (int64_t *)&p_shm_old) == 1) |
if (trie_dict_get(p_trie_file_dict, filename, (int64_t *)&p_shm_old) == 1) |
| 186 |
{ |
{ |
| 187 |
shmid_old = *((int *)p_shm_old); |
shmid_old = *((int *)p_shm_old); |