mlockall(), mlockall_r()

QNX SDP8.0C Library ReferenceAPIDeveloper

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:

Note:
In this QNX OS release, all memory is locked for the entire duration of the process, so this function does nothing.

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.

Note:
To lock pages, ensure that the process has the PROCMGR_AID_MEM_LOCK ability enabled.

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).
CAUTION:
In earlier releases, this function could return errors under certain conditions. For QNX SDP 8, this function always succeeds. For more information, refer to the QNX SDP 8.0.x Release Notes.

Classification:

POSIX 1003.1 ML

Safety:
Cancellation pointNo
Signal handlerYes
ThreadYes
Page updated: