garlik/4store — pull request #89 by arekinath (2012-10-30 01:08:33+00:00)
Title: Avoid using pwrite with mmap (or use msync)

Using pwrite and mmap together is not guaranteed by POSIX to produce
consistent results unless you call msync() a lot, which is terribly
slow in most situations, as it waits for a full flush to permanent
storage.

For rhash, this patch converts the pwrite calls to use mmap I/O. For
ptree, it uses msync(), as ptree only calls pwrite when the file
is currently unmapped (so only an msync before munmap should be
necessary)

This fixes up a few more tests that were failing on OpenBSD, yay.
Most of the fails that are left now are just un-ordered queries that return
their results in a different order than they do on Linux (as quads seem
to end up in different segments).