msync
msync is an operation that synchronizes a range of a shared file-backed memory mapping with its underlying file, with MS_SYNC waiting for completion.
On Linux, MS_ASYNC has been a no-op since 2.6.19 because dirty-page tracking already drives writeback; it is not a durability completion point. MAP_PRIVATE modifications do not update the backing file. MS_SYNC is not the distinct MAP_SYNC mapping flag used with DAX-capable files.
Relations
- related
- fsync, fdatasync, sync-file-range
Advantages
- Provides explicit synchronization for a selected mapped range.
Limitations
- The starting address must be page-aligned; portable callers specify exactly one of MS_SYNC and MS_ASYNC.
- Does not make private mapping changes persistent or provide an atomic application transaction.