HP-UX Reference (11i v2 07/12) - 2 System Calls (vol 5)

m
msync(2) msync(2)
RETURN VALUE
Upon successful completion, msync() returns 0. Otherwise, it returns
-1 and sets errno to indicate
the error.
ERRORS
The
msync() function will fail if:
[EAGAIN] A transient error occurred while writing to the file system.
[EINVAL] The addr argument is not a multiple of the page size as returned by
sysconf(_SC_PAGE_SIZE)
.
[EINVAL] The address range specified by addr and len was not created by a successful call to
mmap().
[EIO] An I/O error occurred while reading from or writing to the file system.
[ENOMEM] Some or all the addresses in the range [addr, addr+len] are invalid for the address
space of the process. Or, pages that are not mapped are specified.
APPLICATION USAGE
The
msync() function should be used by programs that require a memory object to be in a known state.
For example, in building transaction facilities.
Normal system activity can cause pages to be written to disk. Therefore, there are no guarantees that
msync() is the only control over when pages are or are not written to disk.
AUTHOR
msync() was developed by HP, AT&T, and OSF.
SEE ALSO
mmap(2), sysconf(2), <sys/mman.h>.
STANDARDS CONFORMANCE
msync(): AES, SVID3
232 Hewlett-Packard Company 2 HP-UX 11i Version 2: December 2007 Update