munmap()

QNX SDP8.0C Library ReferenceAPIDeveloper

Unmap previously mapped addresses

Synopsis:

#include <sys/mman.h>

int munmap( void * addr,
            size_t len );

Arguments:

addr
The beginning of the range of addresses that you want to unmap.
len
The length of the range of addresses, in bytes.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

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. References to unmapped 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.

Note:
To avoid undesired behavior, don't use mmap() to map the same region of typed memory cached, unmap() it, then mmap() it uncached. You need to ensure that the cache is flushed between calls to mmap().

Returns:

0
Success.
-1
Failure; errno is set.

Errors:

See munmap_flags().

Classification:

POSIX 1003.1 SHM|TYM

Safety:
Cancellation pointNo
Signal handlerYes
ThreadYes
Page updated: