Re: msync() needed before munmap() when writing to shared mapping?

From: H. Peter Anvin
Date: Sat Apr 17 2004 - 15:26:18 EST

Followup to: <20040416220223.GA27084@xxxxxxxxxxxxxxxxxx>
By author: Jamie Lokier <jamie@xxxxxxxxxxxxx>
In newsgroup:
> > munmap() and fsync() or msync() will flush it to disk; there is no
> > reason munmap() should unless perhaps the file was opened O_SYNC.
> That was talking about flushing data all the way to disk. The
> implication of hpa's response is that munmap() does propagate the
> dirty bits from the page table to the file. That is the obvious
> behaviour, and what I've always assumed.

Obvious behaviour, and required by POSIX.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at