munmap_flags()

QNX SDP8.0C Library ReferenceAPIDeveloper

Unmap previously mapped addresses, exercising more control than possible with munmap()

Synopsis:

#include <sys/mman.h>

int munmap_flags( void * addr,
                  size_t len,
                  unsigned flags );

Arguments:

addr
The beginning of the range of addresses that you want to unmap.
len
The length of the range of addresses, in bytes.
flags
There are no currently defined flags; pass 0 for this argument.

Library:

libc

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

Description:

The munmap_flags() 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_flags() has no effect.

Returns:

0
Success.
-1
Failure; errno is set.

Errors:

EINVAL
The addresses in the specified range are outside the range allowed for the address space of a process.
EINTR
The call was interrupted by a signal.
ENOMEM
The memory manager failed to allocate memory to handle the unmapping request. This allocation of memory is necessary for internal structures to represent the new state of mapped memory.

Classification:

QNX OS

Safety:
Cancellation pointNo
Signal handlerYes
ThreadYes
Page updated: