diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-10-28 13:37:04 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-11-01 04:55:24 -0400 |
commit | 70b62c97622f6527cf606af052fb1f0f14783b28 (patch) | |
tree | 859d941aa68bdf2823329370d56621aac992d9fe /rts | |
parent | 214d81220d89ba76350a0eefa837c90797298595 (diff) | |
download | haskell-70b62c97622f6527cf606af052fb1f0f14783b28.tar.gz |
mmap: Factor out protection flags
Diffstat (limited to 'rts')
-rw-r--r-- | rts/Linker.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/rts/Linker.c b/rts/Linker.c index 1f3d8162be..34028d4490 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -1023,15 +1023,14 @@ mmap_again: map_addr = mmap_32bit_base; } + const int prot = PROT_READ | PROT_WRITE | PROT_EXEC; IF_DEBUG(linker, - debugBelch("mmapForLinker: \tprotection %#0x\n", - PROT_EXEC | PROT_READ | PROT_WRITE)); + debugBelch("mmapForLinker: \tprotection %#0x\n", prot)); IF_DEBUG(linker, debugBelch("mmapForLinker: \tflags %#0x\n", MAP_PRIVATE | tryMap32Bit | fixed | flags)); - result = mmap(map_addr, size, - PROT_EXEC|PROT_READ|PROT_WRITE, + result = mmap(map_addr, size, prot, MAP_PRIVATE|tryMap32Bit|fixed|flags, fd, offset); if (result == MAP_FAILED) { |