memobj_lock_phys()

Prevent an object from moving in physical memory

Synopsis:

#include <memobj/physmem.h>
errno_t memobj_lock_phys(struct memobj *obj)

Arguments:

obj
A handle to a memory object.

Library:

libmemobj

Description:

The memobj_lock_phys() function prevents an object from moving in physical memory. While an object is locked, the kernel cannot page it out or move its physical memory pages. You can use memobj_get_phys_layout() to determine the physical addresses.

Returns:

This function may return any error documented for memobj_map(), as well as any of the following:

EOK
The memory was successfully locked.
ENOMEM
Locking the pages would have exceeded the limit on the amount of memory the process may lock (RLIMIT_MEMLOCK).
EPERM
The process didn't have the required permission (refer to PROCMGR_AID_MEM_LOCK for procmgr_ability()).
Page updated: