autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: detecting mmap?


From: Donn Terry
Subject: RE: detecting mmap?
Date: Fri, 19 Jul 2002 10:20:18 -0700

1) POSIX can't do it first (by a matter of policy that simply isn't
going to change).
There has to be existing practice.  Thus, someone's gotta try it.

2) Since the standard is explicit (and I suspect there's a good reason
for that explicitness
that accessing the additional address space is an error, but I don't
know what is), that change
in behavior must be turned on by a (nonstardard) flag.

3) Thus, MAP_ALL (or however you want to spell it) that says "give me
the whole of size I
asked for" (which would let you map a st_size+1 region, and be sure that
you always had
at least one byte past the EOF)).

And I agree: there need to be multiple MMAP tests (as was really
suggested in that mail
trail that Akim forwarded).  There are different uses, and the "minimal"
case is actually
quite useful.  (I like having a single MMAP test emit multiple flags;
that would make
it much easier for applications to simply change to test for what they
need.)

Donn

-----Original Message-----
From: Bruce Korb [mailto:address@hidden 
Sent: Friday, July 19, 2002 10:05 AM
To: Donn Terry
Cc: Paul Eggert; address@hidden
Subject: Re: detecting mmap?


Donn Terry wrote:

> (You do make a good point, however.  Maybe we need to consider adding 
> a "MAP_ALL" flag to mmap() that says "validly map size, even if it's 
> bigger than the object" (and zero fill)).
> That could be prototyped now, and proposed for the next POSIX if it
> works out to be useful.
> (Yeah, I know, it doesn't solve the immediate problem, but in the long
> run....))

That is a fix POSIX should make to mmap spec so it can do the oversize
mapping.  If you try to mmap a PAGESIZE file into a 2*PAGESIZE chunk of
memory, the second page won't be mapped.
strlen() still faults.  It's the spec.  It's dumb.  It's too early for a
"MAP_ALL".  Anyway, back to the real argument: it is pretty clear that
either multiple tests are required, or you have to parameterize the
features and either select what you want or have a feature test that
emits multiple results:

  #define MMAP_CAN_MAP_HEAP
  #define MMAP_CAN_MAP_FIXED
  #define HAVE_MMAP /* to some minimal degree */
  ... etc



reply via email to

[Prev in Thread] Current Thread [Next in Thread]