#include <sys/mman.h>
int mlockall(flags) int flags;
int munlockall()
mlockall() locks all pages mapped by an address space in memory. The value of flags determines whether the pages to be locked are simply those currently mapped by the address space, those that will be mapped in the future, or both. flags is built from the options defined in <sys/mman.h> as:
#define MCL_CURRENT 0x1 /* lock current mappings */ #define MCL_FUTURE 0x2 /* lock future mappings */
If MCL_FUTURE is specified to mlockall() , then as mappings are added to the address space (or existing mappings are replaced) they will also be locked, provided sufficient memory is available.
Mappings locked via mlockall() with any option may be explicitly unlocked with a munlock() call.
munlockall() removes address space locks and locks on mappings in the address space.
All conditions and constraints on the use of locked memory as exist for mlock() apply to mlockall() .
mlockall() and munlockall() return:
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97