X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=linux%2Fplat.c;h=707d5f74e3e16533f48e11355d2d0f2e05cab273;hb=533726df95e88932d0bf72345a438ae415b8c04e;hp=779d5b127123e7525624c41f628a95c982e069dc;hpb=a23a278d1ef19ca2adbe23f56defe006d5433e32;p=libpicofe.git diff --git a/linux/plat.c b/linux/plat.c index 779d5b1..707d5f7 100644 --- a/linux/plat.c +++ b/linux/plat.c @@ -75,7 +75,7 @@ int plat_get_skin_dir(char *dst, int len) { int ret = plat_get_exe_dir(dst, len); if (ret < 0) - return ret; + ret = 0; memcpy(dst + ret, "skin/", sizeof "skin/"); return ret + sizeof("skin/") - 1; @@ -86,7 +86,7 @@ int plat_get_skin_dir(char *dst, int len) #endif int plat_get_root_dir(char *dst, int len) { -#if !defined(__GP2X__) && !defined(PANDORA) +#if !defined(NO_HOME_DIR) && !defined(__GP2X__) && !defined(PANDORA) const char *home = getenv("HOME"); int ret; @@ -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; +#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)) { @@ -223,8 +227,11 @@ void *plat_mremap(void *ptr, size_t oldsize, size_t newsize) { 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);