aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2019-09-12 10:01:33 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-09-12 10:01:33 -0400
commitc00d70982fd3fbbb3fd429ddfa2b1d143f7ac9f0 (patch)
tree8122c5aed8a383f9abf24f6e56175131a350bbc3
parentefl_ui_calendar_item: document this class a little bit more (diff)
downloadefl-c00d70982fd3fbbb3fd429ddfa2b1d143f7ac9f0.tar.gz
Evil: fix mmap() and define HAVE_MMAP
Summary: add size of file mapping to fix invalid parameter Test Plan: compilation (edje succeeds) and elm_test Reviewers: zmike, cedric, raster Reviewed By: zmike Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9913
-rw-r--r--src/lib/evil/evil_dlfcn.h2
-rw-r--r--src/lib/evil/evil_mman.c12
-rw-r--r--src/lib/evil/evil_mman.h4
-rw-r--r--src/lib/evil/evil_stdlib.h2
4 files changed, 17 insertions, 3 deletions
diff --git a/src/lib/evil/evil_dlfcn.h b/src/lib/evil/evil_dlfcn.h
index c6d5d1acf2..9e39be5967 100644
--- a/src/lib/evil/evil_dlfcn.h
+++ b/src/lib/evil/evil_dlfcn.h
@@ -144,7 +144,7 @@ struct Dl_info
*/
EAPI void *dlopen(const char* path, int mode);
#ifndef HAVE_DLOPEN
-#define HAVE_DLOPEN 1
+# define HAVE_DLOPEN 1
#endif
/**
* @brief Close a dynamic-link library.
diff --git a/src/lib/evil/evil_mman.c b/src/lib/evil/evil_mman.c
index dbcfc31901..42f8021e59 100644
--- a/src/lib/evil/evil_mman.c
+++ b/src/lib/evil/evil_mman.c
@@ -58,6 +58,8 @@ mmap(void *addr EVIL_UNUSED,
DWORD acs = 0;
HANDLE handle;
void *data;
+ DWORD low;
+ DWORD high;
/* get protection */
protect = _evil_mmap_protection_get(prot);
@@ -89,7 +91,15 @@ mmap(void *addr EVIL_UNUSED,
}
}
- fm = CreateFileMapping(handle, NULL, protect, 0, 0, NULL);
+#ifdef _WIN64
+ low = (DWORD)((len >> 32) & 0x00000000ffffffff);
+ low = (DWORD)(len & 0x00000000ffffffff);
+#else
+ high = 0L;
+ low = len;
+#endif
+
+ fm = CreateFileMapping(handle, NULL, protect, high, low, NULL);
if (!fm)
{
fprintf(stderr, "[Evil] [mmap] CreateFileMapping failed: %s\n",
diff --git a/src/lib/evil/evil_mman.h b/src/lib/evil/evil_mman.h
index 990d146058..747917d204 100644
--- a/src/lib/evil/evil_mman.h
+++ b/src/lib/evil/evil_mman.h
@@ -114,6 +114,10 @@ EAPI void *mmap(void *addr,
int fd,
off_t offset);
+#ifndef HAVE_MMAP
+# define HAVE_MMAP 1
+#endif
+
/**
* Unmaps a mapped view of a file from the calling process's
* address space.
diff --git a/src/lib/evil/evil_stdlib.h b/src/lib/evil/evil_stdlib.h
index a5645b7585..eae2fb8809 100644
--- a/src/lib/evil/evil_stdlib.h
+++ b/src/lib/evil/evil_stdlib.h
@@ -116,7 +116,7 @@ EAPI int mkstemps(char *__template, int suffixlen);
*/
EAPI char *realpath(const char *file_name, char *resolved_name);
#ifndef HAVE_REALPATH
-#define HAVE_REALPATH 1
+# define HAVE_REALPATH 1
#endif