Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

munmap(2) [opensolaris man page]

munmap(2)							   System Calls 							 munmap(2)

NAME
munmap - unmap pages of memory SYNOPSIS
#include <sys/mman.h> int munmap(void *addr, size_t len); DESCRIPTION
The munmap() function removes the mappings for pages in the range [addr, addr + len), rounding the len argument up to the next multiple of the page size as returned by sysconf(3C). If addr is not the address of a mapping established by a prior call to mmap(2), the behavior is undefined. After a successful call to munmap() and before any subsequent mapping of the unmapped pages, further references to these pages will result in the delivery of a SIGBUS or SIGSEGV signal to the process. The mmap(2) function often performs an implicit munmap(). RETURN VALUES
Upon successful completion, munmap() returns 0; otherwise, it returns -1 and sets errno to indicate an error. ERRORS
The munmap() function will fail if: EINVAL The addr argument is not a multiple of the page size as returned by sysconf(3C); addresses in the range [addr, addr + len) are outside the valid range for the address space of a process; or the len argument has a value less than or equal to 0. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
mmap(2), sysconf(3C), attributes(5), standards(5) SunOS 5.11 5 Jan 1998 munmap(2)

Check Out this Related Man Page

munmap(2)							System Calls Manual							 munmap(2)

NAME
munmap - Unmaps a mapped region SYNOPSIS
#include <sys/mman.h> int munmap ( void *addr, size_t len ); [Tru64 UNIX] The following definition of the munmap() function does not conform to current standards and is supported only for backward compatibility (see standards(5)): #include <sys/mman.h> int munmap ( caddr_t addr, size_t len ); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: munmap(): XSH5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Specifies the address of the region to be unmapped. Specifies the length in bytes of the region to be unmapped. DESCRIPTION
The munmap() function unmaps a mapped file or shared memory region. The addr and len parameters specify the address and length in bytes, respectively, of the region to be unmapped. The len parameter must be a multiple of the page size as returned by sysconf(_SC_PAGE_SIZE). If len is not a multiple of the page size as returned by sysconf(_SC_PAGE_SIZE), the length of the region will be rounded up to the next multiple of the page size. The result of using an address which lies in an unmapped region and not in any subsequently mapped region is undefined. RETURN VALUES
Upon successful completion, the munmap() function returns 0 (zero). Otherwise, munmap() returns -1 and sets errno to indicate the error. ERRORS
If the munmap() function fails, errno may be set to one of the following values: The range [addr, addr + len) includes an invalid address. The addr parameter is not a multiple of the page size as returned by sysconf(_SC_PAGE_SIZE). The len parameter is 0 (zero). RELATED INFORMATION
Functions: mmap(2), sysconf(3) Standards: standards(5) delim off munmap(2)
Man Page