PLOCK(S) XENIX System V PLOCK(S)
Name
plock - Lock process, text, or data in memory.
Syntax
#include <sys/lock.h>
int plock (op)
int op;
Description
plock allows the calling process to lock its text segment
(text lock), its data segment (data lock), or both its text
and data segments (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 root user to use this call.
op specifies the following:
PROCLOCK
Lock text and data segments into memory.
TXTLOCK
Lock text segment into memory.
DATLOCK
Lock data segment into memory.
UNLOCK
Remove all process locks.
plock will fail and not perform the requested operation if
one or more of the following are true:
The effective user ID of the calling process is not root.
[EPERM]
op is equal to PROLOCK 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. [EINVAL]
Return Value
Upon successful completion, a value of 0 is returned to the
calling process. Otherwise, a value of -1 is returned and
errno is set to indicate the error.
Page 1 (printed 8/7/87)
PLOCK(S) XENIX System V PLOCK(S)
See Also
exec(S), exit(S), fork(S)
Page 2 (printed 8/7/87)