Content-type: text/html Man page of munmap

munmap

Section: System Calls (2)
Index Return to Main Contents
 

NAME

munmap - Unmaps a mapped region  

SYNOPSIS

#include <sys/mman.h>

int munmap (        void *addr,
       size_t len );

[Digital]  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(): XPG4-UNIX

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).  

RELATED INFORMATION

Functions: mmap(2), sysconf(3)

Standards: standards(5) delim off


 

Index

NAME
SYNOPSIS
STANDARDS
PARAMETERS
DESCRIPTION
RETURN VALUES
ERRORS
RELATED INFORMATION

This document was created by man2html, using the manual pages.
Time: 02:40:18 GMT, October 02, 2010