On Nov  9 05:50, Eric Blake wrote:
> According to Corinna Vinschen on 11/9/2009 4:59 AM:
> > MAP_FIXED
> >   [...]
> >   If the specified address cannot be used, mmap() will fail.  Because
> >   requiring a fixed address for a mapping is less portable, the use of
> >   this option is discouraged.
> 
> It's an upstream issue now ;)
> 
> The problem is that I need some more advice from the cygwin list on how
> best to fix the test to pass on cygwin by default.  I'm hoping to release
> autoconf 2.65 this week, so a speedy fix to help this issue go away before
> the release would be extra nice.

This part of the testcase

  data2 = (char *) malloc (2 * pagesize);
  if (!data2)
    return 1;
  data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1);
  if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
                       MAP_PRIVATE | MAP_FIXED, fd, 0L))
    return 1;

is bad.  The chance that the address of data2 is not usable for mmap on
Windows/Cygwin is 100%.  The problem here is that the generic HAVE_MMAP
test tests one certain feature, which is not usable on Windows, and which
is non-portable.  So, on Cygwin this test always fails and all applications
using this test in good faith will never use mmap on Cygwin, just because
the single case of "mmap private fixed at somewhere already mapped" doesn't
work.  In fact, most applications don't need this case.
And grep wouldn't need it either, since the method used in grep would
also work if the area hadn't been malloced before, if it would just use
the address returned by mmap as buffer.

That's why I think we need at least two tests in autoconf, a generic
mmap test and a mmap test for the "mmap private/shared fixed at
somewhere already mapped" case, if an application actually insists on
using that.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply via email to