PLOCK(2) SysV PLOCK(2)
NAME
plock - lock process, text, or data in memory
SYNOPSIS
#include <sys/lock.h>
int plock (op)
int op;
DESCRIPTION
Domain/OS SysV provides plock for compatibility only. The subsequent
discussion describes plock's function as documented for UNIX System V,
Release 3.
plock allows the calling process to lock its text segment (text lock),
its data segment (data lock), or both (process lock) into memory. Locked
segments are immune to all routine swapping. plock also allows these
segments to be unlocked. The effective user ID of the calling process
must be super-user to use this call. op specifies the following:
PROCLOCK Process lock -- Lock text and data segments into memory
TXTLOCK Text lock -- Lock text segment into memory
DATLOCK Data lock -- Lock data segment into memory
UNLOCK Remove locks
ERRORS
plock will fail and not perform the requested operation if one or more of
the following are true:
[EPERM] The effective user ID of the calling process is not super-
user.
[EINVAL] op is equal to PROCLOCK and a process lock, a text lock, or a
data lock already exists on the calling process.
[EINVAL] op is equal to TXTLOCK and a text lock, or a process lock
already exists on the calling process.
[EINVAL] op is equal to DATLOCK and a data lock or a process lock
already exists on the calling process.
[EINVAL] op is equal to UNLOCK and no type of lock exists on the
calling process.
[EAGAIN] Not enough memory.
SEE ALSO
exec(2), exit(2), fork(2).
Domain/OS Design Principles.
DIAGNOSTICS
A successful call returns 0. A failed call returns -1 and sets errno.
NOTES
The functionality plock purports to provide in UNIX System V, Release 3
is irrelevant to the single-level store virtual memory management scheme
of Domain/OS. In that scheme, the disk, as well as physical memory, acts
as primary storage, so that the notion of "swapping" is irrelevant.
plock cannot prevent paging, the process whereby Domain/OS does I/O to
the disk.