From f9b6dd9d2d347028c1607b3ab09dd9156f96fdd8 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 11 Mar 2015 17:06:45 +0100 Subject: [PATCH] proplib: anonymous mappings need MAP_ANON. Somehow I removed this accidentally in a previous change... sigh. --- lib/portableproplib/prop_object.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/portableproplib/prop_object.c b/lib/portableproplib/prop_object.c index 3afb4d93..335b0c6b 100644 --- a/lib/portableproplib/prop_object.c +++ b/lib/portableproplib/prop_object.c @@ -40,7 +40,9 @@ static pthread_mutex_t _prop_refcnt_mtx = PTHREAD_MUTEX_INITIALIZER; #endif /* _PROP_NEED_REFCNT_MTX */ +#define __USE_MISC /* MAP_ANON on glibc */ #include +#undef __USE_MISC #include #include #include @@ -957,7 +959,7 @@ _prop_object_internalize_map_file(const char *fname) if (need_guard) { if (mmap(mf->poimf_xml + mf->poimf_mapsize, pgsize, PROT_READ, - MAP_PRIVATE|MAP_FIXED, -1, + MAP_ANON|MAP_PRIVATE|MAP_FIXED, -1, (off_t)0) == MAP_FAILED) { (void) munmap(mf->poimf_xml, mf->poimf_mapsize); _PROP_FREE(mf, M_TEMP);