plock.2

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 2 代码 · 共 91 行

2
91
字号
.\" SCCSID: @(#)plock.2	8.1	9/11/90.TH plock 2.SH Nameplock \- lock or unlock process, text, or data in memory.SH Syntax.B #include <sys/lock.h>.PP.B int plock (op).br.B int op;.SH Description.NXR "plock system call"The.PN plockcall 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 page outs, and the process is immuneto swap outs.  The.PN plockcall also unlocks these segments..PPThe.I opargument specifies the following:.IP PROCLOCK 1iLock text and data segments into memory (process lock).IP TXTLOCK 1iLock text segment into memory (text lock).IP DATLOCK 1iLock data segment into memory (data lock).IP UNLOCK 1i Remove locks.SH Return ValuesUpon successful completion, a value of 0 is returned to thecalling process.  Otherwise, a value of \-1 is returned, and.I errnois set to indicate the error..SH DiagnosticsThe.PN plock call fails under the following conditions:.TP 15 [EPERM]The effective user ID of the calling process is not superuser..TP 15 [EINVAL]The.I opargument is equal to PROCLOCK, and a process lock,a text lock, or a data lock already exists on thecalling process..TP 15 [EINVAL]The.I op argument is equal to TXTLOCK, and a text lockor a process lock already exists on the calling process..TP 15 [EINVAL]The.I opargument is equal to DATLOCK, and a data lock or a processlock already exists on the calling process..TP 15 [EINVAL]The .I opargument is equal to UNLOCK, and no type of lock existson the calling process..SH Restrictions .NXR "plock system call" "restricted"The effective user ID of the calling process must be superuser touse this call..PPBoth PROCLOCK and TXTLOCK lock the text segment of a process, and a lockedtext segmentis locked for all sharing processes..PPBecause the effective user ID of the calling process is superuser,take care not to lock more virtual pages than can be contained in physical memory.A deadlock can result..SH See Alsoexecve(2), exit(2), fork(2), shmctl(2)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?