*/
if (size >= HUGETLB_THRESHOLD)
flags |= MAP_HUGETLB;
+#ifdef MAP_JIT
+ if (need_exec)
+ flags |= MAP_JIT;
+#endif
ret = mmap(req, size, prot, flags, -1, 0);
if (ret == MAP_FAILED && (flags & MAP_HUGETLB)) {
{
void *ret;
+#ifdef MREMAP_MAYMOVE
ret = mremap(ptr, oldsize, newsize, MREMAP_MAYMOVE);
- if (ret == MAP_FAILED) {
+ if (ret == MAP_FAILED)
+#endif
+ {
fprintf(stderr, "mremap %p %zd %zd: ",
ptr, oldsize, newsize);
perror(NULL);
#define LIBPICOFE_POSIX_H
/* define POSIX stuff: dirent, scandir, getcwd, mkdir */
-#if defined(__linux__) || defined(__MINGW32__)
+#if defined(__MACH__) || defined(__linux__) || defined(__MINGW32__)
#include <dirent.h>
#include <unistd.h>