From owner-man-jp-reviewer@jp.freebsd.org  Wed May 10 00:32:33 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id AAA72988;
	Wed, 10 May 2000 00:32:33 +0900 (JST)
	(envelope-from owner-man-jp-reviewer@jp.FreeBSD.org)
Received: from basil.veltec.co.jp (camomile.veltec.co.jp [211.2.223.5])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id AAA72978
	for <man-jp-reviewer@jp.freebsd.org>; Wed, 10 May 2000 00:32:32 +0900 (JST)
	(envelope-from yuko@veltec.co.jp)
Received: from jade ([192.168.0.66])
	by basil.veltec.co.jp (8.10.0.Beta6/3.7W03/20/00) with ESMTP
	id e49Fd0t14257
	for <man-jp-reviewer@jp.freebsd.org>; Wed, 10 May 2000 00:39:00 +0900 (JST)
To: man-jp-reviewer@jp.freebsd.org
X-SMIME-fingerprint: A7:AE:D4:83:9D:5B:A5:F2:24:8F:F4:DC:87:3C:72:89
From: Yuko Sasaki <yuko@veltec.co.jp>
Message-Id: <200005100033.HBH48288.LPVZ@veltec.co.jp>
X-Mailer: Winbiff [Version 2.31 beta1]
Date: Wed, 10 May 2000 00:33:31 +0900
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-2022-jp
Reply-To: man-jp-reviewer@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: man-jp-reviewer 2436
Subject: [man-jp-reviewer 2436] (man2) munmap.2
Errors-To: owner-man-jp-reviewer@jp.freebsd.org
Sender: owner-man-jp-reviewer@jp.freebsd.org
X-Originator: yuko@veltec.co.jp

$B!V(Bm$B!W$^$G=*$o$j$G$9!#(B

$B!V$G:G=i$K8=$l$^$7$?!#!W(B -> $B!V$G$O$8$a$FEP>l$7$^$7$?!#!W(B

------- $B$3$3$+$i(B --------------------------------------------------
.\" Copyright (c) 1991, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" 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
.\" SUCH DAMAGE.
.\"
.\"	@(#)munmap.2	8.3 (Berkeley) 5/27/94
.\"
.Dd May 27, 1994
.Dt MUNMAP 2
.Os
.Sh $BL>>N(B
.Nm munmap
.Nd $B%^%C%T%s%0$r=|5n$9$k(B
.Sh $B=q<0(B
.Fd #include <sys/types.h>
.Fd #include <sys/mman.h>
.Ft int
.Fn munmap "void *addr" "size_t len"
.Sh $B2r@b(B
.Fn munmap
$B%7%9%F%`%3!<%k$O!";XDj%"%I%l%9HO0O$K$D$$$F%^%C%T%s%0$r=|5n$7!"(B
$BHO0OFb$N%"%I%l%9$X$N$=$l0J>e$N;2>H$K$h$C$FL58z$J%a%b%j;2>H$,@8@.$5$l$k$h$&$K(B
$B$7$^$9!#(B
.Sh $BLa$jCM(B
$B@5>o$K40N;$9$k$H!"(B
.Fn munmap
$B$O%<%m$rJV$7$^$9!#$=$&$G$J$$>l9g!"CM(B -1 $B$,JV$5$l!"(B
$B%(%i!<$r<($9$?$a$K(B
.Va errno
$B$,@_Dj$5$l$^$9!#(B
.Sh $B%(%i!<(B
.Fn munmap
$B$O<!$N>l9g$K<:GT$7$^$9!#(B
.Bl -tag -width Er
.It Bq Er EINVAL
.Fa addr
$B%Q%i%a!<%?$,%Z!<%8$K@0Ns$7$F$$$J$+$C$?$+!"(B
.Fa len
$B%Q%i%a!<%?$,Ii$G$"$C$?$+!"(B
$B$^$?$O%"%s%^%C%W$5$l$F$$$kNN0h$N0lIt$,%W%m%;%9$K$H$C$FM-8z$JHO0O$N30B&$K(B
$B$"$j$^$9!#(B
.Sh $B4XO"9`L\(B
.Xr madvise 2 ,
.Xr mincore 2 ,
.Xr mprotect 2 ,
.Xr msync 2 ,
.Xr munmap 2 ,
.Xr getpagesize 3
.Sh $BNr;K(B
.Fn munmap
$B4X?t$O(B
.Bx 4.4
$B$G$O$8$a$FEP>l$7$^$7$?!#(B
------- $B$3$3$^$G(B --------------------------------------------------

------- $B86J8!&$3$3$+$i(B --------------------------------------------------
.\" Copyright (c) 1991, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" 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
.\" SUCH DAMAGE.
.\"
.\"	@(#)munmap.2	8.3 (Berkeley) 5/27/94
.\"
.Dd May 27, 1994
.Dt MUNMAP 2
.Os
.Sh NAME
.Nm munmap
.Nd remove a mapping
.Sh SYNOPSIS
.Fd #include <sys/types.h>
.Fd #include <sys/mman.h>
.Ft int
.Fn munmap "void *addr" "size_t len"
.Sh DESCRIPTION
The
.Fn munmap
system call
deletes the mappings for the specified address range,
and causes further references to addresses within the range
to generate invalid memory references.
.Sh RETURN VALUES
Upon successful completion,
.Fn munmap
returns zero.
Otherwise, a value of -1 is returned and
.Va errno
is set to indicate the error.
.Sh ERRORS
.Fn Munmap
will fail if:
.Bl -tag -width Er
.It Bq Er EINVAL
The
.Fa addr
parameter was not page aligned, the
.Fa len
parameter was negative, or
some part of the region being unmapped is outside the
valid address range for a process.
.Sh "SEE ALSO"
.Xr madvise 2 ,
.Xr mincore 2 ,
.Xr mprotect 2 ,
.Xr msync 2 ,
.Xr munmap 2 ,
.Xr getpagesize 3
.Sh HISTORY
The
.Fn munmap
function first appeared in
.Bx 4.4 .
------- $B86J8!&$3$3$^$G(B --------------------------------------------------
