mmap specification - was: ... select specification

Andries Brouwer
2004-10-07T22:03:44Z

On Thu, Oct 07, 2004 at 03:50:31PM +0100, Alan Cox wrote:

> I'll quote SuSv3 to illustrate the danger of "specifications"
>
> "The system shall always zero-fill any partial page at the end of an
> object. Further, the system shall never write out any modified portions
> of the last page of an object which are beyond its end. References
> within the address range starting at pa and continuing for len bytes to
> whole pages following the end of an object shall result in delivery of a
> SIGBUS signal."
>
> Its a mistake, its not apparent if its actually meant something entirely
> different or someone forgot a "not", or what is going on.

What precisely are you thinking of?
You seem to think this is ridiculous.
The way I read this, Linux is compliant, I think.

[I read this as follows: If you mmap a file with MAP_SHARED and modify
the memory at an address so far beyond EOF that it is not in a page
containing stuff from the file, then you get a SIGBUS. -- Linux does this.
Also, that if you modify the memory at an address beyond EOF, then
the file is not modified. -- Again Linux does this.]

Andries