01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PLOCK(2) PLOCK(2)<br />

NAME<br />

plock - lock process, text, or data in memory<br />

SYNOPSIS<br />

#include <br />

int plock (op)<br />

int op;<br />

DESCRIPTION<br />

Plock allows the calling process to lock its text segment (text<br />

lock), its data segment (data lock), or both its text and data segments<br />

(process lock) into memory. Locked segments are immune<br />

to all routine swapping. Plock also allows these segments to be<br />

unlocked. The effective user ID of the calling process must be<br />

super-user to use this call. Op specifies the following:<br />

PROCLOCK - lock text and data segments into<br />

memory (process lock)<br />

TXTLOCK - lock text segment into memory (text<br />

lock)<br />

DATLOCK - lock data segment into memory (data<br />

lock)<br />

UNLOCK - remove locks<br />

Plock will fail and not perform the requested operation if one or<br />

more of the following are true:<br />

The effective user ID of the calling process is not superuser.<br />

[EPERM[<br />

Op is equal to PROCLOCK and a process lock, a text<br />

lock, or a data lock already exists on the calling process.<br />

[EINVAL[<br />

Op is equal to TXTLOCK and a text lock, or a process<br />

lock already exists on the calling process. [EINV AL]<br />

Op is equal to DATLOCK and a data lock, or a process<br />

lock already exists on the calling process. [EINVAL]<br />

Op is equal to UNLOCK and no type of lock exists on the<br />

calling process. [EINV AL]<br />

RETURN VALUE<br />

Upon successful completion, a value of 0 is returned to the calling<br />

process. Otherwise, a value of -1 is returned and errno is set to<br />

indicate the error.<br />

SEE ALSO<br />

exec(2), exit(2), fork(2).<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!