mlockall(), mlockall_r()
Lock all of a process's address space
Synopsis:
#include <sys/mman.h>
int mlockall(int flags);
int mlockall_r(int flags);
Arguments:
- flags
- Flags that indicate which pages to lock; one or more of the following bits:
- MCL_CURRENT
- Lock the pages currently mapped into the address space of the process.
- MCL_FUTURE
- Lock the pages that become mapped into the address space of the process in the future, when the mappings are established.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The mlockall() and mlockall_r() functions cause all of the pages mapped by the calling process's address space to be locked and made memory-resident until they're unlocked or until the process exits or is replaced by an exec*() call.
Memory-resident is a term used to indicate that the addresses always reside in physical memory.
For more information, see
Memory management
in the Process Manager chapter of the System Architecture guide.
For more information, refer to the Abilities Reference chapter of the System Security guide.
The mlockall() and mlockall_r() functions are identical, except in the way they indicate errors. Refer to the Returns section for details.
Returns:
The only difference between these functions is the way they indicate errors:
- mlockall()
- This function always returns 0 (success).
- mlockall_r()
- This function always returns EOK (success).
Classification:
| Safety: | |
|---|---|
| Cancellation point | No |
| Signal handler | Yes |
| Thread | Yes |
