diff --git a/third_party/ijar/mapped_file_unix.cc b/third_party/ijar/mapped_file_unix.cc index fbfca42723177f..de46864ef2e8c2 100644 --- a/third_party/ijar/mapped_file_unix.cc +++ b/third_party/ijar/mapped_file_unix.cc @@ -113,7 +113,8 @@ MappedOutputFile::MappedOutputFile(const char* name, size_t estimated_size) size_t mmap_length = std::min(static_cast(estimated_size + sysconf(_SC_PAGESIZE)), std::numeric_limits::max()); - void* mapped = mmap(NULL, mmap_length, PROT_WRITE, MAP_SHARED, fd, 0); + void* mapped = mmap(NULL, mmap_length, PROT_READ|PROT_WRITE, + MAP_SHARED, fd, 0); if (mapped == MAP_FAILED) { snprintf(errmsg, MAX_ERROR, "mmap(): %s", strerror(errno)); errmsg_ = errmsg;