Subject: mmap hints.
To: None <tech-kern@sun-lamp.cs.berkeley.edu>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: tech-kern
Date: 11/30/1993 19:47:17
I propose to change line 169 in vm_mmap.c
from
if (addr == 0 && (flags & MAP_FIXED) == 0)
addr = ...;
to
if (addr < round_page(p->p_vmspace->vm_daddr + MAXDSIZ) &&
(flags & MAP_FIXED) == 0)
addr = ...;
The reason is that mmap(2) should not map into the process' heap if it
can avoid this, ie. when MAP_FIXED is not set. Mapping into the heap will
cause clashes with `obreak()' which is designed to contiguously expand the
break value and will fail if it finds its seat taken.
You ask which programs provide mmap hints that shoot in their own feet?
All SunOS binaries that use YP do (for no good reason at all). It made for
some interesting errors in the Sun compat box.
-pk
BTW. My ELC is now almost fully functional in multi-user mode. The X11 server
runs sweetly, just xterm's won't quite do what they are supposed to.
------------------------------------------------------------------------------