Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mmap(2)

sysconf(3)

munmap(2)  —  System Calls

OSF

NAME

munmap − Unmaps a mapped region

SYNOPSIS

#include <sys/types.h> #include <sys/mman.h> int munmap (
caddr_t addr,
size_t len );

PARAMETERS

addrSpecifies the address of the region to be unmapped. 

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

NOTES

AES Support Level:
Trial use

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:

[EINVAL]The addr parameter is not a multiple of the page size as returned by sysconf(_SC_PAGE_SIZE). 

[EFAULT]The range [addr, addr + len) includes an invalid address. 

RELATED INFORMATION

Functions: mmap(2), sysconf(3)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026