162915Sbostic.\" Copyright (c) 1991, 1993 262915Sbostic.\" The Regents of the University of California. All rights reserved. 349902Smckusick.\" 450801Scael.\" %sccs.include.redist.roff% 549902Smckusick.\" 6*67258Shibler.\" @(#)munmap.2 8.3 (Berkeley) 05/27/94 749902Smckusick.\" 850801Scael.Dd 950801Scael.Dt MUNMAP 2 1050801Scael.Os 1150801Scael.Sh NAME 1250801Scael.Nm munmap 1350801Scael.Nd remove a mapping 1450801Scael.Sh SYNOPSIS 1554294Sbostic.Fn munmap "caddr_t addr" "size_t len" 1650801Scael.Sh DESCRIPTION 1750801ScaelThe 1850801Scael.Fn munmap 1950801Scaelsystem call 2049902Smckusickdeletes the mappings for the specified address range, 2149902Smckusickand causes further references to addresses within the range 2249902Smckusickto generate invalid memory references. 2366798Smckusick.Sh RETURN VALUES 2466798SmckusickUpon successful completion, 2566798Smckusick.Nm munmap 2666798Smckusickreturns zero. 2766798SmckusickOtherwise, a value of -1 is returned and 2866798Smckusick.Va errno 2966798Smckusickis set to indicate the error. 3066798Smckusick.Sh ERRORS 3166798Smckusick.Fn Munmap 3266798Smckusickwill fail if: 3366798Smckusick.Bl -tag -width Er 3466798Smckusick.It Bq Er EINVAL 3566798SmckusickThe 3666798Smckusick.Fa addr 3766798Smckusickparameter was not page aligned, the 3866798Smckusick.Fa len 3966798Smckusickparameter was negative, or 40*67258Shiblersome part of the region being unmapped is outside the 41*67258Shiblervalid address range for a process. 4266798Smckusick.Sh "SEE ALSO" 4366798Smckusick.Xr getpagesize 2 , 4450801Scael.Xr msync 2 , 4566798Smckusick.Xr munmap 2 , 4666798Smckusick.Xr mprotect 2 , 4750801Scael.Xr madvise 2 , 4850801Scael.Xr mincore 2 4950801Scael.Sh HISTORY 5050801ScaelThe 5150801Scael.Fn munmap 5262914Sbosticfunction first appeared in 4.4BSD. 53