From b5bf87044f4db7bcc104bbc11a63724cbe166a63 Mon Sep 17 00:00:00 2001 From: schwarze Date: Sat, 9 Aug 2014 14:24:49 +0000 Subject: [PATCH] mmap(2) requires MAP_PRIVATE ^ MAP_SHARED for flags; found by kristaps@ on Mac OS X --- usr.bin/mandoc/mansearch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/mandoc/mansearch.c b/usr.bin/mandoc/mansearch.c index b457453ca3c..32fb2d9fe6b 100644 --- a/usr.bin/mandoc/mansearch.c +++ b/usr.bin/mandoc/mansearch.c @@ -1,4 +1,4 @@ -/* $Id: mansearch.c,v 1.30 2014/08/08 17:36:21 schwarze Exp $ */ +/* $Id: mansearch.c,v 1.31 2014/08/09 14:24:49 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons * Copyright (c) 2013, 2014 Ingo Schwarze @@ -112,7 +112,8 @@ mansearch_setup(int start) } pagecache = mmap(NULL, PC_PAGESIZE * PC_NUMPAGES, - PROT_READ | PROT_WRITE, MAP_ANON, -1, 0); + PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_ANON, -1, 0); if (MAP_FAILED == pagecache) { perror("mmap"); -- 2.20.1