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/

  • AC_FUNC_MMAP ... Yury V. Zaytsev
    • Re: AC_F... Yury V. Zaytsev
      • Re: ... Bob Friesenhahn
        • ... Paul Eggert
          • ... Bob Friesenhahn
            • ... Zack Weinberg
              • ... Yury V. Zaytsev
              • ... Bob Friesenhahn
                • ... Howard Chu via Discussion list for the autoconf build system
              • ... Paul Eggert
          • ... Yury V. Zaytsev
          • ... Brooks Davis
            • ... Yury V. Zaytsev
              • ... Zack Weinberg
                • ... Howard Chu via Discussion list for the autoconf build system
                • ... Zack Weinberg
                • ... Russ Allbery
                • ... Howard Chu via Discussion list for the autoconf build system
                • ... Russ Allbery

Reply via email to