int mlockall(int flags);
The mlockall() function cause all of the pages
mapped by the address space of a process to be memory-resident until
unlocked or until the process exits or execs
another process image.
The flags argument determines whether the pages
to be locked are those currently mapped by the address space of the process,
those that are mapped in the future, or both.
The flags argument is constructed from the bitwise-inclusive
OR of one or more of the following symbolic constants, defined
Locks all pages currently mapped into the address space of the process.
Locks all pages that become mapped into the address space of the
process in the future, when those mappings are established.
The appropriate privilege is required to lock process memory with
The munlockall() function unlocks all currently
mapped pages of the address space of the process. Any pages that
become mapped into the address space of the process after a call
to munlockall() are not locked, unless there
is an intervening call to mlockall() specifying
MCL_FUTURE or a subsequent call to mlockall()
If pages mapped into the address space of the process are also mapped
into the address spaces of other processes and are locked by those
processes, the locks established by the other processes are unaffected
by the munlockall() call.
Specifies the flags that determine whether the pages to be locked are those
currently mapped, those that are mapped in the future, or both.
The munlockall() function always returns 0.
On success, the mlockall() function returns 0.
On failure, the mlockall() function returns -1, locks no
additional memory, and sets errno to one of the following:
Some or all of the memory identified by the operation could not be
locked when the call was made.
The flags argument is zero, or includes unimplemented flags.
Locking all of the pages currently mapped into the address space of the
process would exceed the amount of memory that the process may lock.
The calling process does not have the appropriate privilege to perform
the requested operation.
On the NuTCRACKER Platform the mlockall() function
requires the calling process to have the
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
- exec(), exit(), fork(), mlock(), munmap()
PTC MKS Toolkit 10.3 Documentation Build 39.