POSIX compliance issue with mmap(2)

Garrett Cooper yanegomi at gmail.com
Thu Jul 29 16:39:00 UTC 2010


On Thu, Jul 29, 2010 at 8:20 AM, Garrett Wollman <wollman at csail.mit.edu> wrote:
> <<On Wed, 28 Jul 2010 23:47:03 -0700, Garrett Cooper <yanegomi at gmail.com> said:
>
>>     According to the page noted below [1], mmap(2) should fail if the
>> value isn't page-aligned:
>
>> [EINVAL]
>>     The addr argument (if MAP_FIXED was specified) or off is not a
>> multiple of the page size as returned by sysconf(), or is considered
>> invalid by the implementation.
>
> This may be a bug in the standard (since this is a "shall fail"
> condition, and there's no reason it has to fail if the application
> didn't specify MAP_FIXED).

There are a number of opengroup manpages I've seen use the `shall
fail' tort in the ERRORs sections -- some being connect(2), open(2),
etc. I'll see if I can get clarification on whether or not there is
any wiggle room if it states "shall fail if".

Thanks,
-Garrett


More information about the freebsd-standards mailing list