SYNOPSIS
#include <sys/mman.h>
int msync(void *addr, size_t len, int flags);
DESCRIPTION
The function
addr must be a multiple
of the page size as returned by
For mappings to files, the
The flags argument is constructed from the bitwise inclusive OR of one or more of the following flags:
- MS_ASYNC
-
Perform asynchronous writes
- MS_SYNC
-
Perform synchronous writes.
- MS_INVALIDATE
-
Invalidate cached data.
When MS_ASYNC is specified,
When MS_INVALIDATE is specified,
PARAMETERS
- addr
-
Is the address of the region from where data should be written to the permanent storage locations.
- len
-
Is the number of bytes to be written to the permanent storage locations.
- flags
-
Is the bitwise inclusive OR of MS_ASYNC (or MS_SYNC) and MS_INVALIDATE.
RETURN VALUES
If successful, the
- EINVAL
-
The addr argument is not a multiple of the page size as returned by
sysconf() . - EINVAL
-
The value in flags is invalid.
- ENOMEM
-
Addresses in the range [addr, addr + len] are invalid for the address space of a process, or specify one or more pages which are not mapped.
CONFORMANCE
UNIX 98, with exceptions.
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
Windows does not distinguish the flags MS_SYNC and MS_ASYNC. The flag MS_INVALIDATE is ignored by the system.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
PTC MKS Toolkit 10.4 Documentation Build 39.