Subject: Re: Zero-length mmaps
To: None <>
From: Kailash Sethuraman <>
List: tech-kern
Date: 08/21/2006 17:25:23
On 8/21/06, Thor Lancelot Simon <> wrote:
> On Mon, Aug 21, 2006 at 03:01:29PM +0000, Kailash Sethuraman wrote:
> > On 8/20/06, Jason Thorpe <> wrote:
> > >
> > >NetBSD's mmap should be fixed.  We should probably version the symbol
> > >so old programs continue to run, but new programs get the new behavior.
> > >
> >
> > >From my code reading, please correct me if I am wrong,
> > It does seem to be the case that when a mmap with length 0 is
> > specified,size passed to uvm_mmap() can be 0.
> [...]
> > Does this warrant a PR for ld.elf_so, and possibly other programs in
> > base that do 0 length mmaps?
> >
> > Or must valgrind be  taught to accomodate this case in netbsd?
> I will note that we do not claim anywhere to slavishly conform to SUS (of
> any version); rather, we say we will conform to _reasonable_ standards.
> The interface in question (mmap(2)) is a BSD interface, to which SUS seems
> to have made a largely arbitrary change.  Whether we change it to match SUS
> or not, valgrind should probably be fixed to understand the traditional
> behavior.

Alright, many thanks for that clarification.
I have made changes  in the ongoing valgrind for netbsd port to match
this behaviour. When/If  there are  changes to mmap as suggested, that
can be accommodated for as well, as long as the symbol is versioned.