1.\" Copyright (c) 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" %sccs.include.redist.roff% 5.\" 6.\" @(#)munmap.2 8.3 (Berkeley) 05/27/94 7.\" 8.Dd 9.Dt MUNMAP 2 10.Os 11.Sh NAME 12.Nm munmap 13.Nd remove a mapping 14.Sh SYNOPSIS 15.Fn munmap "caddr_t addr" "size_t len" 16.Sh DESCRIPTION 17The 18.Fn munmap 19system call 20deletes the mappings for the specified address range, 21and causes further references to addresses within the range 22to generate invalid memory references. 23.Sh RETURN VALUES 24Upon successful completion, 25.Nm munmap 26returns zero. 27Otherwise, a value of -1 is returned and 28.Va errno 29is set to indicate the error. 30.Sh ERRORS 31.Fn Munmap 32will fail if: 33.Bl -tag -width Er 34.It Bq Er EINVAL 35The 36.Fa addr 37parameter was not page aligned, the 38.Fa len 39parameter was negative, or 40some part of the region being unmapped is outside the 41valid address range for a process. 42.Sh "SEE ALSO" 43.Xr getpagesize 2 , 44.Xr msync 2 , 45.Xr munmap 2 , 46.Xr mprotect 2 , 47.Xr madvise 2 , 48.Xr mincore 2 49.Sh HISTORY 50The 51.Fn munmap 52function first appeared in 4.4BSD. 53