summaryrefslogtreecommitdiff
path: root/monitor_mm.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor_mm.c')
-rw-r--r--monitor_mm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/monitor_mm.c b/monitor_mm.c
index b383193cd..b9ea978a6 100644
--- a/monitor_mm.c
+++ b/monitor_mm.c
@@ -26,7 +26,9 @@
26#include "includes.h" 26#include "includes.h"
27RCSID("$OpenBSD: monitor_mm.c,v 1.4 2002/03/25 20:12:10 stevesk Exp $"); 27RCSID("$OpenBSD: monitor_mm.c,v 1.4 2002/03/25 20:12:10 stevesk Exp $");
28 28
29#ifdef HAVE_SYS_MMAN_H
29#include <sys/mman.h> 30#include <sys/mman.h>
31#endif
30 32
31#include "ssh.h" 33#include "ssh.h"
32#include "xmalloc.h" 34#include "xmalloc.h"
@@ -82,10 +84,15 @@ mm_create(struct mm_master *mmalloc, size_t size)
82 */ 84 */
83 mm->mmalloc = mmalloc; 85 mm->mmalloc = mmalloc;
84 86
87#ifdef HAVE_MMAP
85 address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED, 88 address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED,
86 -1, 0); 89 -1, 0);
87 if (address == MAP_FAILED) 90 if (address == MAP_FAILED)
88 fatal("mmap(%lu)", (u_long)size); 91 fatal("mmap(%lu)", (u_long)size);
92#else
93 fatal("%s: UsePrivilegeSeparation=yes not supported",
94 __FUNCTION__);
95#endif
89 96
90 mm->address = address; 97 mm->address = address;
91 mm->size = size; 98 mm->size = size;