QNX Developer Support
|This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.|
Unmap previously mapped addresses
#include <sys/mman.h> int munmap( void * addr, size_t len );
- The beginning of the range of addresses that you want to unmap.
- The length of the range of addresses, in bytes.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The munmap() function removes any mappings for pages in the address range starting at addr and continuing for len bytes, rounded up to the next multiple of the page size. Subsequent references to these pages cause a SIGSEGV signal to be set on the process.
If there are no mappings in the specified address range, then munmap() has no effect.
- Failure; errno is set.
- The addresses in the specified range are outside the range allowed for the address space of a process.
- The function munmap() isn't supported by this implementation.
Currently, you can't munmap() just a part of an area mapped with mmap().