NAME | SYNOPSIS | LIBRARY | API RESTRICTIONS | FEATURES | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO
#include <sys/mman.h>int munmap(void *addr, size_t len);
Standard C Library (libc, -lc)
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
POSIX_SHM
The munmap() system call removes mappings for the specified address range, starting at addr and continuing for len bytes. Further references to these pages will result in a segmentation fault. If there are no pages (mapping, data or code) in the specified address range, munmap() has no effect. Otherwise, all pages are freed with no verification of their type.
The implementation requires that addr be a multiple of the page size. If len is not a multiple of the page size, the system rounds it up to the next page boundary.
If a mapping to be removed is private, any modifications made in this address range are discarded.
Upon successful completion, munmap() returns a value of 0. Otherwise, it returns a value of -1 and sets errno to indicate the error.
The munmap() system will fail if:
The munmap() system is not supported.
The POSIX_SHM feature is not configured.
The addr parameter is outside the range allowed for the address space of a process.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | LIBRARY | API RESTRICTIONS | FEATURES | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO