1 /* $Id: mmap.c 7598 2007-02-09 02:40:51Z eagle $
3 ** MMap manipulation routines
5 ** Written by Alex Kiernan (alex.kiernan@thus.net)
7 ** These routines work with mmap()ed memory
12 #include "portable/mmap.h"
14 #include "inn/messages.h"
18 ** Figure out what page an address is in and flush those pages
21 inn__mapcntl(void *p, size_t length, int flags)
25 pagesize = getpagesize();
27 syswarn("getpagesize failed");
31 start = (char *)((size_t)p & ~(size_t)(pagesize - 1));
32 end = (char *)((size_t)((char *)p + length + pagesize) &
33 ~(size_t)(pagesize - 1));
34 msync(start, end - start, flags);