Re: mmap-related questions

Benjamin LaHaise
2003-03-31T17:44:27Z

On Mon, Mar 31, 2003 at 06:41:10AM -0800, Kenny Simpson wrote:
> I tested that fsync() does not seem to sync pages that
> were mapped with mmap. Is there some way to sync all
> data associated with the file? Is there a way which
> is also portable to Solaris 2.6?

No. You must use msync(). Note that fsync() after munmap() will flush the
pages to disk under Linux.

> BTW: I'm using 2.4.7 (RH enterprise)

2.4.7 is way out of date and should be updated for the numerous bugfixes and
security errata.

-ben