This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 1.7.0 CVS mmap failure

mmap() is supposed to zero-fill, not refuse to map when len
is less than the system page size. I have never ever seen
mmap() fail to map less than page size on any typical Posix

       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.

Back to the original issue, consider this:

0x100000	Allocates memory at the highest possible address.

If there were any kind of simple arithmetic bug behind mmap()'s
scenes (such as computing space to zero-fill, etc. etc.) I would
think ENOMEM would be a very common scenario if we're allocating
near the end of addressible space.


On Fri, Jan 05, 2007 at 05:06:50PM +0100, Samuel Thibault wrote:
> Not sure about the cygwin state, but at least on the Linux/Posix side,
> mmap() is not supposed to be able to work with a smaller granularity
> than a memory page.
> Samuel

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]