Unmap previously mapped addresses, exercising more control than possible with munmap()
int munmap_flags( void * addr,
unsigned flags );
- The beginning of the range of addresses that you want to unmap.
- The length of the range of addresses, in bytes.
- Use the following values:
- Behave the same as munmap().
- POSIX initialization of the page to all zeros is required the next time
the underlying physical memory is allocated.
- Initialization of the underlying physical memory to zeros on its next
allocation is optional.
Use the -l c option to
to link against this library.
This library is usually included automatically.
The munmap_flags() function removes any mappings for pages in
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.
||This function was added in the QNX Neutrino Core OS 6.3.2.|
There are some interactions of the flags argument with the
MAP_NOINIT flag of the
function as well as
as detailed below:
- The mmap() function has a new flag, MAP_NOINIT.
When specified, the POSIX requirement that the memory be zeroed is
The physical memory being used for this allocation must have been
previously freed with UNMAP_INIT_OPTIONAL for this flag
to have any effect.
- The procnto command line now has an
The memmgr_configuration string has a sequence of
configuration options to enable (or if preceeded with a ~
character, disable) memory-manager aspects.
The configuation options are:
- munmap_flags() (with flags parameter as zero) acts as if UNMAP_INIT_REQUIRED
were specified (the default).
- munmap_flags() (with flags parameter as zero) acts as if UNMAP_INIT_OPTIONAL
- 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_flags() isn't supported by this implementation.
in the Utilities Reference
“Initializing allocated memory”
in the Interprocess Communication (IPC) chapter of the
System Architecture guide