--- lbbs/src/file_loader.c 2025/05/18 08:17:25 1.8 +++ lbbs/src/file_loader.c 2025/05/23 14:11:38 1.10 @@ -174,6 +174,14 @@ int load_file_shm(const char *filename) p_line_offsets = p_data + data_len + 1; memcpy(p_line_offsets, line_offsets, sizeof(long) * (size_t)(line_total + 1)); + // Remap shared memory in read-only mode + p_shm = shmat(shmid, p_shm, SHM_RDONLY | SHM_REMAP); + if (p_shm == (void *)-1) + { + log_error("shmat(shmid=%d) error (%d)\n", shmid, errno); + return -3; + } + if (trie_dict_get(p_trie_file_dict, filename, (int64_t *)&p_shm_old) == 1) { shmid_old = *((int *)p_shm_old);