X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/9bccf70c0258c7cac2dcb80011b2a964d884c552..4bd07ac2140668789aa3ee8ec4dde4a3e0a3bba5:/bsd/man/man2/msync.2 diff --git a/bsd/man/man2/msync.2 b/bsd/man/man2/msync.2 index 831b8af34..f61a3b813 100644 --- a/bsd/man/man2/msync.2 +++ b/bsd/man/man2/msync.2 @@ -41,28 +41,24 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.Fd #include .Fd #include .Ft int -.Fn msync "void *addr" "size_t len" "int flags" +.Fo msync +.Fa "void *addr" +.Fa "size_t len" +.Fa "int flags" +.Fc .Sh DESCRIPTION The .Fn msync -system call -writes any modified pages back to the filesystem and updates -the file modification time. -If -.Fa len -is 0, all modified pages within the region containing -.Fa addr -will be flushed; -if -.Fa len -is non-zero, only those pages containing +system call writes modified whole pages back to the filesystem +and updates the file modification time. +Only those pages containing .Fa addr and .Fa len-1 succeeding locations will be examined. +.Pp The .Fa flags argument may be specified as follows: @@ -71,6 +67,10 @@ MS_ASYNC Return immediately MS_SYNC Perform synchronous writes MS_INVALIDATE Invalidate all cached data .Ed +.Pp +The +.Fa MS_ASYNC +flag is not permitted to be combined with other flags. .Sh RETURN VALUES If any errors occur, -1 is returned and errno is set to indicate the error. @@ -79,24 +79,45 @@ Otherwise, a 0 value is returned. .Fn msync will fail if: .Bl -tag -width Er +.\" =========== +.It Bq Er EBUSY +Some of the specified addresses are locked +and MS_INVALIDATE is specified. +.\" =========== .It Bq Er EINVAL .Fa addr is not a multiple of the hardware page size. +.\" =========== .It Bq Er EINVAL .Fa len -is too large or negative. +is too large, or less than 1. +.\" =========== .It Bq Er EINVAL .Fa flags -was both MS_ASYNC and MS_INVALIDATE. -Only one of these flags is allowed. +is invalid +(e.g., it combines MS_ASYNC with another flag, +which is not permitted). +.\" =========== .It Bq Er EIO -An I/O error occurred while writing to the file system. +An I/O error occurs while writing to the file system. +.\" =========== +.It Bq Er ENOMEM +The specified address range is outside of the address range +of the process or includes an unmapped page. .El +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +The include file +.In sys/types.h +is necessary. .Sh SEE ALSO .Xr madvise 2 , .Xr mincore 2 , .Xr mprotect 2 , -.Xr munmap 2 +.Xr munmap 2 , +.Xr compat 5 .Sh HISTORY The .Fn msync