#include <sys/types.h> #include <sys/mman.h>
int msync(addr, len, flags) caddr_t addr; size_t len; int flags;
msync() writes all modified copies of pages over the range [addr, addr + len) to their permanent storage locations. msync() optionally invalidates any copies so that further references to the pages will be obtained by the system from their permanent storage locations.
Values for flags are defined in <sys/mman.h> as:
#define MS_ASYNC 0x1 /* Return immediately */ #define MS_INVALIDATE 0x2 /* Invalidate mappings */
and are used to control the behavior of msync(). One or more flags may be specified in a single call.
MS_ASYNC returns immediately once all I/O operations are scheduled; normally, msync() will not return until all I/O operations are complete. MS_INVALIDATE invalidates all cached copies of data from memory objects, requiring them to be re-obtained from the object's permanent storage location upon the next reference.
msync() should be used by programs that require a memory object to be in a known state, for example in building transaction facilities.
msync() returns:
flags is not some combination of MS_ASYNC or MS_INVALIDATE.
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97