aboutsummaryrefslogtreecommitdiff
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.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Support/Unix/Memory.inc b/lib/Support/Unix/Memory.inc
index 72a8af621d..6be3ee045f 100644
--- a/lib/Support/Unix/Memory.inc
+++ b/lib/Support/Unix/Memory.inc
@@ -156,8 +156,12 @@ Memory::protectMappedMemory(const MemoryBlock &M, unsigned Flags) {
return error_code(EINVAL, generic_category());
int Protect = getPosixProtectionFlags(Flags);
-
+#ifndef __native_client__
int Result = ::mprotect(M.Address, M.Size, Protect);
+#else
+ int Result = -1;
+ llvm_unreachable("Native client does not support mprotect");
+#endif
if (Result != 0)
return error_code(errno, system_category());