Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/sys/mmap.2
Show All 22 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 | .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd February 18, 2015 | .Dd November 25, 2016 | ||||
.Dt MMAP 2 | .Dt MMAP 2 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm mmap | .Nm mmap | ||||
.Nd allocate memory, or map files or devices into memory | .Nd allocate memory, or map files or devices into memory | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libc | .Lb libc | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | |||||
Typically this prevents the update daemons from flushing pages dirtied | Typically this prevents the update daemons from flushing pages dirtied | ||||
through such maps and thus allows efficient sharing of memory across | through such maps and thus allows efficient sharing of memory across | ||||
unassociated processes using a file-backed shared memory map. | unassociated processes using a file-backed shared memory map. | ||||
Without | Without | ||||
this option any VM pages you dirty may be flushed to disk every so often | this option any VM pages you dirty may be flushed to disk every so often | ||||
(every 30-60 seconds usually) which can create performance problems if you | (every 30-60 seconds usually) which can create performance problems if you | ||||
do not need that to occur (such as when you are using shared file-backed | do not need that to occur (such as when you are using shared file-backed | ||||
mmap regions for IPC purposes). | mmap regions for IPC purposes). | ||||
Dirty data will be flushed automatically when all mappings of an object are | |||||
removed and all descriptors referencing the object are closed. | |||||
Note that VM/file system coherency is | Note that VM/file system coherency is | ||||
maintained whether you use | maintained whether you use | ||||
.Dv MAP_NOSYNC | .Dv MAP_NOSYNC | ||||
or not. | or not. | ||||
This option is not portable | This option is not portable | ||||
across | across | ||||
.Ux | .Ux | ||||
platforms (yet), though some may implement the same behavior | platforms (yet), though some may implement the same behavior | ||||
▲ Show 20 Lines • Show All 251 Lines • Show Last 20 Lines |