PLOCK(2,L) AIX Technical Reference PLOCK(2,L)
-------------------------------------------------------------------------------
plock
PURPOSE
Locks the process, text, or data in memory.
SYNTAX
#include <sys/lock.h>
int plock (op)
int op;
DESCRIPTION
The plock system call allows the calling process to lock or unlock its text
segment (text lock), its data segment (data lock), or both its text and data
segments (process lock) into memory. Locked segments are pinned in memory and
are immune to all routine paging. The effective user ID of the calling process
must be superuser to use this call.
The op parameter specifies one of the following operations:
PROCLOCK Locks text and data segments into memory (process lock).
TXTLOCK Locks text segment into memory (text lock).
DATLOCK Locks data segment into memory (data lock).
UNLOCK Removes locks.
RETURN VALUE
Upon successful completion, a value of 0 is returned to the calling process.
If plock fails, a value of -1 is returned and errno is set to indicate the
error.
ERROR CONDITIONS
The plock system call fails if one or more of the following are true:
EPERM The effective user ID of the calling process is not superuser.
EINVAL The op parameter has a value other than PROCLOCK, TXTLOCK, DATLOCK, or
UNLOCK.
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.
Processed November 7, 1990 PLOCK(2,L) 1
PLOCK(2,L) AIX Technical Reference PLOCK(2,L)
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.
RELATED INFORMATION
In this book: "exec: execl, execv, execle, execve, execlp, execvp," "exit,
_exit," and "fork, vfork."
Processed November 7, 1990 PLOCK(2,L) 2