PLOCK(2) — Unix Programmer’s Manual
NAME
plock − lock the current process in core
SYNOPSIS
plock()
DESCRIPTION
Plock locks the current process in core. The process is made fully resident by faulting in all the pages. Once locked, neither the process nor any of its pages get swapped out. The process can be unlocked by the punlock call.
This call can be executed only by the super-user.
NOTES
When a plocked process asks for more memory, it may have to wait indefinitely if enough memory is not available.
If a plocked process is forked, both the child and parent processes are in plocked state. As more memory is needed, the parent may have to wait indefinitely.
If the plocked process execs a new image, it gets unlocked.
RETURN VALUE
Zero is returned if the operation was successful; on an error, −1 is returned and an error code is left in the global location errno.
ERRORS
The plock call fails if:
[EPERM] The caller is not the super-user.
[ENOMEM] The system does not have sufficient physical memory, or the limit, as set by setrlimit(2), is exceeded.
SEE ALSO
punlock(2), highpri(2), normalpri(2), setrlimit(2)
4th Berkeley Distribution — 1 August 1985