summaryrefslogtreecommitdiffstats
path: root/include/inn/mmap.h
blob: 3769d5144af7ffd6c2a67a0c97e040f4bdd57959 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*  $Id: mmap.h 7598 2007-02-09 02:40:51Z eagle $
**
**  MMap manipulation routines
**
**  Written by Alex Kiernan (alex.kiernan@thus.net)
**
**  These routines work with mmap()ed memory
*/

#ifndef INN_MMAP_H
#define INN_MMAP_H 1

#include <inn/defines.h>

BEGIN_DECLS

/* Figure out what page an address is in and flush those pages.  This is the
   internal function, which we wrap with a define below. */
void inn__mapcntl(void *, size_t, int);

/* Some platforms only support two arguments to msync.  On those platforms,
   make the third argument to mapcntl always be zero, getting rid of whatever
   the caller tried to pass.  This avoids undefined symbols for MS_ASYNC and
   friends on platforms with two-argument msync functions. */
#ifdef INN_HAVE_MSYNC_3_ARG
# define inn_mapcntl inn__mapcntl
#else
# define inn_mapcntl(p, l, f) inn__mapcntl((p), (l), 0)
#endif

END_DECLS

#endif /* INN_MMAP_H */