Subject: vm_mmap bug (more ideas)
To: None <core@netbsd.org>
From: Gordon W. Ross <gwr@jericho.mc.com>
List: tech-kern
Date: 11/29/1994 13:06:51
I just looked again at my POSIX 1003.1b and found:

	NOTE:  It is expected that a later amendment of this
	standard will disallow the implementation from imposing
	the restriction on the alignment of the off and addr
	arguments.

If that happens, the only thing required of the mmap parameters
is, when MAP_FIXED is specified, the ADDR and OFF parameters
must have the same remainder modulo the PAGESIZE.

So, if we plan ahead here, we could make the mmap call deal
with a non-aligned OFF and ADDR parameters.  All it would
need to to is compute the page-offset part of OFF, create
the mapping (using page-aligned ADDR and OFF), and then
return the page-aligned map address plus the page-offset.

I think I'll take a whack at this since it would mean we
could guarantee page-aligned file-offsets in the VM system
without breaking the existing libc code.

Sorry I didn't think of this sooner...
Gordon