notaz.gp2x.de
/
libpicofe.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
2de059c
)
add minimal osx/ios compilastion support
author
kub
<derkub@gmail.com>
Mon, 22 Mar 2021 22:07:02 +0000
(23:07 +0100)
committer
kub
<derkub@gmail.com>
Wed, 26 Jan 2022 19:39:48 +0000
(19:39 +0000)
linux/plat.c
patch
|
blob
|
blame
|
history
posix.h
patch
|
blob
|
blame
|
history
diff --git
a/linux/plat.c
b/linux/plat.c
index
45ae371
..
9109a32
100644
(file)
--- a/
linux/plat.c
+++ b/
linux/plat.c
@@
-192,6
+192,10
@@
void *plat_mmap(unsigned long addr, size_t size, int need_exec, int is_fixed)
*/
if (size >= HUGETLB_THRESHOLD)
flags |= MAP_HUGETLB;
*/
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)) {
ret = mmap(req, size, prot, flags, -1, 0);
if (ret == MAP_FAILED && (flags & MAP_HUGETLB)) {
@@
-223,8
+227,11
@@
void *plat_mremap(void *ptr, size_t oldsize, size_t newsize)
{
void *ret;
{
void *ret;
+#ifdef MREMAP_MAYMOVE
ret = mremap(ptr, oldsize, newsize, 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);
fprintf(stderr, "mremap %p %zd %zd: ",
ptr, oldsize, newsize);
perror(NULL);
diff --git
a/posix.h
b/posix.h
index
ca30edb
..
257c27f
100644
(file)
--- a/
posix.h
+++ b/
posix.h
@@
-2,7
+2,7
@@
#define LIBPICOFE_POSIX_H
/* define POSIX stuff: dirent, scandir, getcwd, mkdir */
#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>
#include <dirent.h>
#include <unistd.h>