kern/71258: [vm] [patch] anonymous mmappings not always page aligned

Martin Kammerhofer dada at sbox.tugraz.at
Sat Nov 17 03:10:11 PST 2007


Quoting kmacy at FreeBSD.org:

>
> Please comment on whether or not it is worth updating the docs
> or this is just blatant pilot error.
>

Either the code should be changed to ignore the MAP_ANON offset as the manpage
currently says, or - simpler solution - the manpage should state, that for
anonymous mappings the offset must be aligned to the page size.
This would bring the manpage in line with the specs; modulo the fact that
illegal offsets cause "undefined behaviour" rather than failing with EINVAL.

Relying on the current manpage wording a programmer _might_ try to save a few
cycles by e.g. passing an uninitialized offset variable. (This is rather
unlikely, but nevertheless having precise manpages is always a good thing.)

  Martin



More information about the freebsd-bugs mailing list