plock(2) SDK R4.11 plock(2)
NAME
plock - lock data, text, or both into memory
SYNOPSIS
#include <sys/lock.h>
int plock(int command);
where:
command The specific operation to be performed
DESCRIPTION
The behavior of this call is implementation dependent. Its only
effects are on performance, both of the process and of the system.
The plock() function allows the calling process to lock its text
segment, its data segment, or both into primary memory. Locking a
segment via plock() has no real effect in this implementation. True
memory locking support is available via the memcntl(2) page locking
operations.
The semantics of plock depend upon the value of command as follows:
TXTLOCK Lock text segment into memory. An error is returned and no
change is made if the text segment is already locked.
DATLOCK Lock data segment into memory. An error is returned and no
change is made if the data segment is already locked.
PROCLOCK Lock text and data segments into memory. An error is
returned and no change is made if either the text or data
segments are already locked.
UNLOCK Remove locks. This single operation unlocks all currently
locked segments - text, data, or both. An error is
returned and no change is made if neither text nor data is
locked.
Note that a TXTLOCK and a DATLOCK operation, in either order, are
equivalent to a PROCLOCK operation.
Locks are not inherited across a fork(2) or vfork(2).
ACCESS CONTROL
The calling process must have appropriate privilege to successfully
execute this system call. For systems supporting the DG/UX
Capability Option, appropriate privilege is defined as having one or
more specific capabilities enabled in the effective capability set of
the calling process. See capdefaults(5) for the default capability
for this system call.
On systems without the DG/UX Capability Option, appropriate privilege
means that the process has an effective UID of root. See the
appropriateprivilege(5) man page for more information.
RETURN VALUE
Upon successful completion, plock() returns a value of 0. Otherwise,
it returns the value -1, and sets errno to indicate an error.
DIAGNOSTICS
Under the following conditions, plock() fails and sets errno to:
EPERM if the calling process does not have appropriate
privilege.
EINVAL if command is not a valid command.
EINVAL if TXTLOCK is specified and a text lock already exists
on the calling process.
EINVAL if DATLOCK is specified and a data lock already exists
on the calling process.
EINVAL if PROCLOCK is specified and a text lock or a data
lock already exists on the calling process.
EINVAL if UNLOCK is specified and neither a text nor a data
lock exists on the calling process.
SEE ALSO
memcntl(2), appropriateprivilege(5).
capdefaults(5).
Licensed material--property of copyright holder(s)