xref: /original-bsd/lib/libc/sys/msync.2 (revision 38ca7aa6)
1.\" Copyright (c) 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"	@(#)msync.2	8.1 (Berkeley) 06/09/93
7.\"
8.Dd
9.Dt MSYNC 2
10.Os
11.Sh NAME
12.Nm msync
13.Nd synchronize a mapped region
14.Sh SYNOPSIS
15.Fn msync "caddr_t addr" "int len"
16.Sh DESCRIPTION
17The
18.Fn msync
19system call
20writes any modified pages back to the filesystem and updates
21the file modification time.
22If
23.Fa len
24is 0, all modified pages within the region containing
25.Fa addr
26will be flushed;
27if
28.Fa len
29is non-zero, only the pages containing
30.Fa addr
31and
32.Fa len
33succeeding locations will be examined.
34Any required synchronization of memory caches
35will also take place at this time.
36Filesystem operations on a file that is mapped for shared modifications
37are unpredictable except after an
38.Fn msync .
39.Sh SEE ALSO
40.Xr madvise 2 ,
41.Xr munmap 2 ,
42.Xr mprotect 2 ,
43.Xr mincore 2
44.Sh HISTORY
45The
46.Fn msync
47function first appeared in 4.4BSD.
48