summaryrefslogtreecommitdiff
path: root/lib/Support/Unix/Memory.inc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/Unix/Memory.inc')
-rw-r--r--lib/Support/Unix/Memory.inc4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Support/Unix/Memory.inc b/lib/Support/Unix/Memory.inc
index edbc7938f0cbf..dd39ef935bf92 100644
--- a/lib/Support/Unix/Memory.inc
+++ b/lib/Support/Unix/Memory.inc
@@ -195,6 +195,10 @@ Memory::AllocateRWX(size_t NumBytes, const MemoryBlock* NearBlock,
#if defined(__APPLE__) && (defined(__arm__) || defined(__arm64__))
void *pa = ::mmap(start, PageSize*NumPages, PROT_READ|PROT_EXEC,
flags, fd, 0);
+#elif defined(__NetBSD__) && defined(PROT_MPROTECT)
+ void *pa =
+ ::mmap(start, PageSize * NumPages,
+ PROT_READ | PROT_WRITE | PROT_MPROTECT(PROT_EXEC), flags, fd, 0);
#else
void *pa = ::mmap(start, PageSize*NumPages, PROT_READ|PROT_WRITE|PROT_EXEC,
flags, fd, 0);