.\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" %sccs.include.redist.roff% .\" .\" @(#)munmap.2 8.3 (Berkeley) 05/27/94 .\" .Dd .Dt MUNMAP 2 .Os .Sh NAME .Nm munmap .Nd remove a mapping .Sh SYNOPSIS .Fn munmap "caddr_t 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, .Nm 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 getpagesize 2 , .Xr msync 2 , .Xr munmap 2 , .Xr mprotect 2 , .Xr madvise 2 , .Xr mincore 2 .Sh HISTORY The .Fn munmap function first appeared in 4.4BSD.