diff options
| author | Tom Smeding <tom@tomsmeding.com> | 2026-05-03 22:33:40 +0200 |
|---|---|---|
| committer | Tom Smeding <tom@tomsmeding.com> | 2026-05-03 22:33:40 +0200 |
| commit | ac596adc7455831eed092f69be97fafaefb53ffe (patch) | |
| tree | cc4864b75c6e7e1e98bee03d808716f971b87eeb | |
| parent | 2ed771f8a9938664decf2dfb040ddf2fd66efff6 (diff) | |
mmap: Add MAP_POPULATE
We're going to access the mapping immediately, so might as well
| -rw-r--r-- | cbits/mmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cbits/mmap.c b/cbits/mmap.c index d84fa59..69aeace 100644 --- a/cbits/mmap.c +++ b/cbits/mmap.c @@ -10,7 +10,7 @@ void* tirclogv_mmap(int fd, size_t *lengthp) { perror("stat"); return NULL; } - void *addr = mmap(NULL, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0); + void *addr = mmap(NULL, statbuf.st_size, PROT_READ, MAP_SHARED | MAP_POPULATE, fd, 0); if (addr == NULL) { perror("mmap"); } |
