Lock all of a process's address space
#include <sys/mman.h> int mlockall(int flags);
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The mlockall() function causes all of the pages mapped by the address space of a process to be locked and made memory-resident until unlocked, or the process exits or executes another process. The pages that are locked depend on the flags argument.
|The full POSIX implementation for this function was added in the QNX Neutrino Core OS 6.3.2.|
Memory-resident is a term used to indicate that the addresses always reside in physical memory. For more information, see “Locking memory” in the Process Manager chapter of the System Architecture guide.
You have to be a superuser to lock pages. Follow either of the following approaches when attempting to lock pages:
POSIX 1003.1 ML
mlock(), mmap(), munlock(), munlockall()
“Locking memory” in the Process Manager chapter of the System Architecture guide