[haiku-development] Re: mmap(MAP_COPY) [was: Re: Re: Haiku R1/alpha updating (was decisions)]

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 09 Aug 2008 17:26:58 +0200 CEST

Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:
> On 2008-08-08 at 10:30:53 [+0200], Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
> > wrote:
> > Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:
> > > Agreed. I'd even say that MAP_COPY is superfluous, since
> > > MAP_PRIVATE
> > > should
> > > imply that behavior -- at least I think it's pretty inconsistent
> > > ATM.
> > Looking at the specs, it's definitely allowed to do that; the
> > behaviour
> > in this regard is just mentioned to be "unspecified".
> > The only reason for MAP_COPY would be that it's more expensive than
> > a
> > MAP_PRIVATE that always shows the current data in an unchanged
> > page.
> Yeah, I just can't think of a situation in which one would use
> MAP_PRIVATE
> and still be fine with later changes to the file to be visible. Due
> to the
> fact that the exact behavior is undefined according to the specs, one
> can't
> use it in portable code without also ensuring that the mapped file is
> not
> changed by others. And in case there are no changes, there's also no
> additional overhead with consistent MAP_PRIVATE semantics.

That's true. Since MAP_COPY isn't even in the POSIX specs, I would then
vote for making MAP_PRIVATE behave just like it.
The only argument against that would be apps that rely on that
particular behaviour of MAP_PRIVATE (despite of its unspecified
nature), and then wouldn't work anymore on Haiku. But that would at
least be a bug in that software.

Bye,
   Axel.


Other related posts: