File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / usr / src / man / man2 / plock.2i
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:26:24 2019 UTC (7 years ago) by root
Branches: bsd, MAIN
CVS tags: v121, HEAD
Power 6/32 Unix version 1.21

.TH PLOCK 2
.SH NAME
plock \- lock process, text, or data in memory
.SH SYNOPSIS
.B #include <sys/lock.h>
.PP
.B int plock (op)
.br
.B int op;
.SH DESCRIPTION
.I 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.
.I Plock
also allows these segments to be unlocked.
The effective user \s-1ID\s+1 of the calling process must be super-user to
use this call.
.I Op
specifies the following:
.RS 8
.TP 14
.SM
.B PROCLOCK \-
lock text and data segments into memory (process lock)
.TP
.SM
.B TXTLOCK \-
lock text segment into memory (text lock)
.TP
.SM
.B DATLOCK \-
lock data segment into memory (data lock)
.TP
.SM
.B UNLOCK \-
remove locks
.RE
.PP
.I Plock
fails and does not perform the requested operation if one or more of
the following are true:
.TP 15
.SM
\%[EPERM]
The effective user \s-1ID\s+1 of the calling process is not super-user.
.TP
.SM
\%[EINVAL]
.I Op
is equal to
.SM
.B PROCLOCK
and a process lock, a text lock, or a data lock already exists on the calling
process.
.TP
.SM
\%[EINVAL]
.I Op
is equal to
.SM
.B TXTLOCK
and a text lock, or a process lock already exists on the calling process.
.TP
.SM
\%[EINVAL]
.I Op
is equal to
.SM
.B DATLOCK
and a data lock, or a process lock already exists on the calling
process.
.TP
.SM
\%[EINVAL]
.I Op
is equal to
.SM
.B UNLOCK
and no type of lock exists on the calling process.
.SH RETURN VALUE
Upon successful completion, a value of 0 is returned to the calling process.
Otherwise, a value of \-1 is returned and
.I errno
is set to indicate the error.
.SH SEE ALSO
exec(2), exit(2), fork(2).
.\"	@(#)plock.2	6.2 of 9/6/83

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.