From 155d76193251f1e7612c3a4a3ab1bdfba5438905 Mon Sep 17 00:00:00 2001 From: raster Date: Thu, 21 Apr 2011 11:54:16 +0000 Subject: [PATCH] populate optional. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@58792 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/eina_file.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/eina_file.c b/src/lib/eina_file.c index 6408343..fe04c1c 100644 --- a/src/lib/eina_file.c +++ b/src/lib/eina_file.c @@ -838,8 +838,11 @@ eina_file_map_all(Eina_File *file, Eina_File_Populate rule) { int flags = MAP_SHARED; +// bsd people will lack this feature +#ifdef MAP_POPULATE if (rule == EINA_FILE_POPULATE) flags |= MAP_POPULATE; - +#endif + if (file->global_map == MAP_FAILED) file->global_map = mmap(NULL, file->length, PROT_READ, flags, file->fd, 0); @@ -875,8 +878,10 @@ eina_file_map_new(Eina_File *file, Eina_File_Populate rule, { int flags = MAP_SHARED; +// bsd people will lack this feature +#ifdef MAP_POPULATE if (rule == EINA_FILE_POPULATE) flags |= MAP_POPULATE; - +#endif map = malloc(sizeof (Eina_File_Map)); if (!map) return NULL; -- 2.7.4