HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
m
munmap(2) 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().Ifaddr is not the address
of a mapping established by a prior call to mmap(), the behaviour 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.
RETURN VALUE
Upon successful completion, munmap() returns 0. Otherwise, it returns 1 and sets errno to indicate
the error.
ERRORS
The munmap() function will fails if:
[EINVAL] The addr argument is not a multiple of the page size as returned by
sysconf().
[EINVAL] Addresses in the range [addr, addr+len], are outside the valid range for the address
space of a process.
[EINVAL] The len argument is 0.
SEE ALSO
mmap(2), sysconf(2), <signal.h>, <sys/mman.h>.
CHANGE HISTORY
First released in Issue 4, Version 2.
Section 2196 1 HP-UX Release 11i: December 2000
___
___