From: Ben Gras Date: Wed, 11 Apr 2012 15:15:15 +0000 (+0200) Subject: vm: add MAP_FIXED X-Git-Tag: v3.2.1~605 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doc/syslog.conf.5.html?a=commitdiff_plain;h=99866db8cddf4f611d20ad17c9dd4b1b1bab394c;p=minix.git vm: add MAP_FIXED --- diff --git a/include/sys/mman.h b/include/sys/mman.h index 4a28810ca..406db8c9f 100644 --- a/include/sys/mman.h +++ b/include/sys/mman.h @@ -56,6 +56,8 @@ typedef __off_t off_t; /* file offset */ #define MAP_ALIGNMENT_64KB MAP_ALIGN64K #define MAP_IPC_SHARED 0x0100 /* share changes */ +#define MAP_FIXED 0x0200 /* require mapping to happen at hint */ + /* * Error indicator returned by mmap(2) */ diff --git a/servers/vm/mmap.c b/servers/vm/mmap.c index dc9cc7c88..b74571613 100644 --- a/servers/vm/mmap.c +++ b/servers/vm/mmap.c @@ -88,6 +88,8 @@ int do_mmap(message *m) addr = arch_vir2map(vmp, m->VMM_ADDR); vr = map_page_region(vmp, addr, 0, len, MAP_NONE, vrflags, mfflags); + if(!vr && (m->VMM_FLAGS & MAP_FIXED)) + return ENOMEM; } if (!vr) { /* No address given or address already in use. */