projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
742aea2
)
Deal with non-executable memory on Darwin (only an issue on Darwin/x86 so far)
author
wolfgang.thaller@gmx.net
<unknown>
Thu, 23 Mar 2006 06:17:45 +0000
(06:17 +0000)
committer
wolfgang.thaller@gmx.net
<unknown>
Thu, 23 Mar 2006 06:17:45 +0000
(06:17 +0000)
ghc/rts/RtsUtils.c
patch
|
blob
|
history
diff --git
a/ghc/rts/RtsUtils.c
b/ghc/rts/RtsUtils.c
index
ef7cbb7
..
3e7e225
100644
(file)
--- a/
ghc/rts/RtsUtils.c
+++ b/
ghc/rts/RtsUtils.c
@@
-40,7
+40,7
@@
#include <pthread.h>
#endif
#include <pthread.h>
#endif
-#if defined(openbsd_HOST_OS) || defined(linux_HOST_OS)
+#if defined(openbsd_HOST_OS) || defined(linux_HOST_OS) || defined(darwin_HOST_OS)
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
@@
-352,7
+352,7
@@
stgMallocBytesRWX(int len)
barf("mallocBytesRWX: failed to protect 0x%p; error=%lu; old protection: %lu\n",
addr, (unsigned long)GetLastError(), (unsigned long)dwOldProtect);
}
barf("mallocBytesRWX: failed to protect 0x%p; error=%lu; old protection: %lu\n",
addr, (unsigned long)GetLastError(), (unsigned long)dwOldProtect);
}
-#elif defined(openbsd_HOST_OS) || defined(linux_HOST_OS)
+#elif defined(openbsd_HOST_OS) || defined(linux_HOST_OS) || defined(darwin_HOST_OS)
/* malloced memory isn't executable by default on OpenBSD */
my_uintptr_t pageSize = sysconf(_SC_PAGESIZE);
my_uintptr_t mask = ~(pageSize - 1);
/* malloced memory isn't executable by default on OpenBSD */
my_uintptr_t pageSize = sysconf(_SC_PAGESIZE);
my_uintptr_t mask = ~(pageSize - 1);