Re: AC_FUNC_MMAP test fails on AIX for MAP_FIXED: who's at fault?

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

 



You prompted me to google around a bit more for valid use cases of MAP_FIXED and here is an enlightening StackOverflow post:

https://stackoverflow.com/questions/28575893/when-would-one-use-mmap-map-fixed

So apparently the Autoconf's test doesn’t do anything wrong, but valid use cases for MAP_FIXED are indeed very special.

Is it fair to discard the mmap implementation completely, just because MAP_FIXED is failing? Maybe define something like HAVE_MMAP_MAP_FIXED instead (or not?)… Happy to do any tests on AIX if helpful.

Unfortunately, it seems that the purpose of AC_FUNC_MMAP is already documented:

If the mmap function exists and works correctly, define HAVE_MMAP. This checks only private fixed mapping of already-mapped memory.

But mmap() is a remarkably flexible interface which is only limited by what the operating system will support.

Whoever wrote it had an expectation that it would be used for this purpose.  It would be good to investigate the history of this macro to see if its purpose was always the same or if its scope was later narrowed.

GraphicsMagick includes a derivation of a very old version of this macro, but modified for testing file mapping.  It does not use MAP_FIXED.

Bob

--
Bob Friesenhahn
bfriesen@xxxxxxxxxxxxxxxxxxx, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt





[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux