synchronize memory with physical storage
int msync(caddr_t addr, size_t len, int flags);
The function msync
writes all modified copies of pages over the range
[addr, addr + len)
to their backing storage locations.
optionally invalidates any copies so that further references to the pages
will be obtained by the system from their backing
The backing storage for a modified MAP_SHARED mapping is the file
the page is mapped to;
the backing storage for a modified MAP_PRIVATE mapping is its swap area.
is a bit pattern built from the following values:
perform asynchronous writes
perform synchronous writes
If MS_ASYNC is set, msync returns immediately once all write operations are scheduled;
if MS_SYNC is set, msync does not return until all write operations are completed.
MS_INVALIDATE invalidates all cached copies of data in memory,
so that further references to the pages will be obtained by the system from
their backing storage locations.
The effect of
msync(addr, len, flags)
is equivalent to:
memcntl(addr, len, MC_SYNC, flags, 0, 0)
Upon successful completion, the function msync returns
0; otherwise, it returns -1 and
sets errno to indicate the error.
should be used by programs that require a memory object to
in a known state, for example, in building transaction facilities.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004