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]

 



Bob Friesenhahn wrote:
>> Can any of you think of other subsets of mmap functionality that are
>> worth supplying a test for in autoconf?  Do any of you have time to
>> work on patches for any or all of this?
> 
> GraphicsMagick has a GM_FUNC_MMAP_FILEIO macro which does this:
> 
>    This test is derived from GNU Autoconf's similar macro.
>    The purpose of this test is to verify that files may be memory
>    mapped, and that memory mapping and file I/O are coherent.
> 
>    The test creates a test file, memory maps the file, updates
>    the file using the memory map, and then reads the file using
>    file I/O to verify that the file contains the updates.
> 
> This functionality would be useful in Autoconf if variants are accepted.

With the notable exception of OpenBSD, all modern OSs from the past 20+ years
have unified buffer caches, so coherence is implicitly maintained between mmap
and read/write.

Of course on Windows it's possible to intentionally break coherence by doing
an unbuffered write, which would make any cached copy of a page stale.

-- 
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/




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

  Powered by Linux