for connected embedded systems
![]() |
![]() |
![]() |
![]() |
munmap_flags()
Unmap previously mapped addresses exercising more control
Synopsis:
#include <sys/mman.h>
int munmap( 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
- Use the following values:
- 0
- Behave the same as munmap().
- UNMAP_INT_REQUIRED
- POSIX Initialization of the page to all zeros is required the next time the underlying physical memory is allocated.
- UNMAP_INT_OPTIONAL
- Initialization of the underlying physical memory to zeros on its next allocation is optional.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The munmap_flags() 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.
![]() |
This function was added in the QNX Neutrino Core OS 6.3.2. There are some interactions of flags argument with MAP_NOINIT flag of the mmap() function as well as procnto command line as detailed below:
|
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.
- ENOSYS
- The function munmap_flags() isn't supported by this implementation.
Classification:
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |
See also:
mmap(), mprotect(), munmap(), shm_open(), shm_unlink()
![]() |
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)
