summaryrefslogtreecommitdiff
path: root/openbsd-compat/xmmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat/xmmap.c')
-rw-r--r--openbsd-compat/xmmap.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/openbsd-compat/xmmap.c b/openbsd-compat/xmmap.c
index 74e8a8b13..0fb23269b 100644
--- a/openbsd-compat/xmmap.c
+++ b/openbsd-compat/xmmap.c
@@ -23,21 +23,31 @@
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26/* $Id: xmmap.c,v 1.6 2004/10/06 13:15:44 dtucker Exp $ */ 26/* $Id: xmmap.c,v 1.12 2006/08/24 09:58:36 dtucker Exp $ */
27 27
28#include "includes.h" 28#include "includes.h"
29 29
30#include <sys/types.h>
30#ifdef HAVE_SYS_MMAN_H 31#ifdef HAVE_SYS_MMAN_H
31#include <sys/mman.h> 32#include <sys/mman.h>
32#endif 33#endif
34#include <sys/stat.h>
35
36#ifdef HAVE_FCNTL_H
37# include <fcntl.h>
38#endif
39#include <errno.h>
40#include <stdarg.h>
41#include <string.h>
42#include <unistd.h>
33 43
34#include "log.h" 44#include "log.h"
35 45
36void *xmmap(size_t size) 46void *xmmap(size_t size)
37{ 47{
48#ifdef HAVE_MMAP
38 void *address; 49 void *address;
39 50
40#ifdef HAVE_MMAP
41# ifdef MAP_ANON 51# ifdef MAP_ANON
42 address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED, 52 address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED,
43 -1, (off_t)0); 53 -1, (off_t)0);