summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorCedric BAIL <cedric@efl.so>2013-11-10 09:26:12 +0100
committerCedric BAIL <cedric@efl.so>2013-11-10 09:26:12 +0100
commitda559ee5d0403b145a334c26c5cf9c45cf03f40f (patch)
treef83ca3831e76cfc88eedbae2d0cc8935f450d193 /src/lib/eina
parentecaca1d365b998b3e339b387897c0646b2b3556f (diff)
eina: use portable infrastructure to detect page size.
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/eina_file.c3
-rw-r--r--src/lib/eina/eina_mmap.c9
2 files changed, 3 insertions, 9 deletions
diff --git a/src/lib/eina/eina_file.c b/src/lib/eina/eina_file.c
index 7b8aaff9e6..6d7ee56f54 100644
--- a/src/lib/eina/eina_file.c
+++ b/src/lib/eina/eina_file.c
@@ -37,7 +37,6 @@
37#include <fcntl.h> 37#include <fcntl.h>
38 38
39#define PATH_DELIM '/' 39#define PATH_DELIM '/'
40#define COPY_BLOCKSIZE (4 * 1024 * 1024)
41 40
42#include "eina_config.h" 41#include "eina_config.h"
43#include "eina_private.h" 42#include "eina_private.h"
@@ -67,7 +66,7 @@
67 * @cond LOCAL 66 * @cond LOCAL
68 */ 67 */
69 68
70#define EINA_SMALL_PAGE 4096 69#define EINA_SMALL_PAGE eina_cpu_page_size()
71#define EINA_HUGE_PAGE 16 * 1024 * 1024 70#define EINA_HUGE_PAGE 16 * 1024 * 1024
72 71
73#ifdef HAVE_DIRENT_H 72#ifdef HAVE_DIRENT_H
diff --git a/src/lib/eina/eina_mmap.c b/src/lib/eina/eina_mmap.c
index d8fd2e55f8..8b2853e443 100644
--- a/src/lib/eina/eina_mmap.c
+++ b/src/lib/eina/eina_mmap.c
@@ -147,12 +147,8 @@ eina_mmap_safety_enabled_set(Eina_Bool enabled)
147 struct sigaction sa; 147 struct sigaction sa;
148 148
149 /* find out system page size the cleanest way we can */ 149 /* find out system page size the cleanest way we can */
150#ifdef _SC_PAGESIZE 150 _eina_mmap_pagesize = eina_cpu_page_size();
151 _eina_mmap_pagesize = sysconf(_SC_PAGESIZE); 151
152 if (_eina_mmap_pagesize <= 0) return EINA_FALSE;
153#else
154 _eina_mmap_pagesize = 4096;
155#endif
156 /* no zero page device - open it */ 152 /* no zero page device - open it */
157 if (_eina_mmap_zero_fd < 0) 153 if (_eina_mmap_zero_fd < 0)
158 { 154 {
@@ -169,7 +165,6 @@ eina_mmap_safety_enabled_set(Eina_Bool enabled)
169 flags |= FD_CLOEXEC; 165 flags |= FD_CLOEXEC;
170 fcntl(_eina_mmap_zero_fd, F_SETFD, flags); 166 fcntl(_eina_mmap_zero_fd, F_SETFD, flags);
171#endif 167#endif
172
173 } 168 }
174 /* set up signal handler for SIGBUS */ 169 /* set up signal handler for SIGBUS */
175 sa.sa_sigaction = _eina_mmap_safe_sigbus; 170 sa.sa_sigaction = _eina_mmap_safe_sigbus;