summaryrefslogtreecommitdiff
path: root/src/sys-mmap.h
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2015-08-22 16:00:59 +0000
committerStefan Bühler <stbuehler@web.de>2015-08-22 16:00:59 +0000
commit593599f14acf2ddbe31b24d970266d9e5fcab9c2 (patch)
treefe02b73a8313e80c58daf40d5653455a08cfb2c1 /src/sys-mmap.h
parentfa8b154628faa4ce234d83f99cd9cb64e9a673c3 (diff)
downloadlighttpd-git-593599f14acf2ddbe31b24d970266d9e5fcab9c2.tar.gz
rewrite network (write) backends
From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3012 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'src/sys-mmap.h')
-rw-r--r--src/sys-mmap.h30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/sys-mmap.h b/src/sys-mmap.h
index 94aaa19b..288ac90e 100644
--- a/src/sys-mmap.h
+++ b/src/sys-mmap.h
@@ -1,24 +1,22 @@
-#ifndef WIN32_MMAP_H
-#define WIN32_MMAP_H
+#ifndef LI_SYS_MMAP_H
+#define LI_SYS_MMAP_H
-#ifdef __WIN32
+#if defined(HAVE_SYS_MMAN_H)
+# include <sys/mman.h>
+#else /* HAVE_SYS_MMAN_H */
-#define MAP_FAILED -1
-#define PROT_SHARED 0
-#define MAP_SHARED 0
-#define PROT_READ 0
+# define PROT_SHARED 0
+# define MAP_SHARED 0
+# define PROT_READ 0
-#define mmap(a, b, c, d, e, f) (-1)
-#define munmap(a, b) (-1)
+# define mmap(a, b, c, d, e, f) (-1)
+# define munmap(a, b) (-1)
-#include <windows.h>
+#endif /* HAVE_SYS_MMAN_H */
-#else
-#include <sys/mman.h>
-
-#ifndef MAP_FAILED
-#define MAP_FAILED -1
-#endif
+/* NetBSD 1.3.x needs it; also make it available if mmap() is not present */
+#if !defined(MAP_FAILED)
+# define MAP_FAILED ((char*)-1)
#endif
#endif