Merge pull request #1361 from HackerFoo/remove-map-populate

remove MAP_POPULATE
This commit is contained in:
litghost 2020-06-22 11:21:29 -07:00 committed by GitHub
commit 9749d6d51f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -38,8 +38,8 @@ std::unique_ptr<MemoryMappedFile> MemoryMappedFile::InitWithFile(
new MemoryMappedFile(nullptr, 0));
}
void* file_map = mmap(NULL, statbuf.st_size, PROT_READ,
MAP_PRIVATE | MAP_POPULATE, fd, 0);
void* file_map =
mmap(NULL, statbuf.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
// If mmap() succeeded, the fd is no longer needed as the mapping will
// keep the file open. If mmap() failed, the fd needs to be closed