*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> standard/plock (2)              
Title
Content
Arch
Section
 

Contents


plock(2)							      plock(2)


NAME    [Toc]    [Back]

     plock - lock into memory or unlock	process, text, or data

C SYNOPSIS    [Toc]    [Back]

     #include <sys/lock.h>

     int plock(int op);

DESCRIPTION    [Toc]    [Back]

     plock allows the calling process to lock into memory or unlock its	text
     segment (text lock), its data segment (data lock),	or both	its text and
     data segments (process lock).  Locked segments are	immune to all routine
     swapping.	The calling process must have the super-user privilege to use
     this call.

     plock does	not lock down memory which has been mapped into	the address
     space of a	process	via the	mmap(2)	system call (e.g., IRIX	Arenas).
     These mmaped memory regions may be	locked down using one of the following
     system calls: mpin(2), mlock(3C), mlockall(3C).

     plock does	not lock down the stack	of the calling process.	 The stack of
     a process can only	be locked into memory with the mlockall(3C) system
     call.

     plock performs the	function specified by op:

	  PROCLOCK    Lock text	and data segments into memory (process lock).

	  TXTLOCK     Lock text	segment	into memory (text lock).

	  DATLOCK     Lock data	segment	into memory (data lock).

	  UNLOCK      Remove locks.

     plock fails and does not perform the requested operation if one or	more
     of	the following are true:

     EPERM	    The	calling	process	does not have the super-user
		    privilege.

     EINVAL	    op is equal	to PROCLOCK 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 lock exists on	the calling
		    process.




									Page 1






plock(2)							      plock(2)



     EAGAIN	    Not	enough memory.

SEE ALSO    [Toc]    [Back]

      
      
     intro(2), exec(2),	exit(2), fork(2), getrlimit(2),	mlock(3C),
     mlockall(3C), mpin(2), memcntl(2),	shmctl(2), ulimit(2).

DIAGNOSTICS    [Toc]    [Back]

     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.

WARNING    [Toc]    [Back]

     The plock function	and mlockall/munlockall	pair provide similar
     functionality. Developers should choose the set that best suites their
     application and stick with	it, as mixing the interfaces may result	in
     unexpected	behavior.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
plock Tru64 Lock the text and/or data segments of a process in memory
plock HP-UX lock process, text, data, stack, or shared library in memory
mlock IRIX lock or unlock pages in memory
munlockall OpenBSD lock (unlock) the address space of a process
mlockall OpenBSD lock (unlock) the address space of a process
mlockall FreeBSD lock (unlock) the address space of a process
munlockall NetBSD lock (unlock) the address space of a process
munlockall FreeBSD lock (unlock) the address space of a process
mlockall NetBSD lock (unlock) the address space of a process
mlock FreeBSD lock (unlock) physical pages in memory
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service