vm: add MAP_FIXED

This commit is contained in:
Ben Gras 2012-04-11 17:15:15 +02:00
parent 1e2b3f4326
commit 99866db8cd
2 changed files with 4 additions and 0 deletions

View file

@ -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)
*/

View file

@ -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. */