populate optional.

SVN revision: 58792
This commit is contained in:
Carsten Haitzler 2011-04-21 11:54:16 +00:00
parent b5314ddd6f
commit 3b167a62f5
1 changed files with 7 additions and 2 deletions

View File

@ -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;