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

  man pages->IRIX man pages -> standard/mpin (2)              


MPIN(2)								       MPIN(2)

NAME    [Toc]    [Back]

     mpin, munpin - lock pages in memory

SYNOPSIS    [Toc]    [Back]

     int mpin (void *addr, size_t);

     int munpin	(void *addr, size_t);

DESCRIPTION    [Toc]    [Back]

     mpin reads	into memory all	pages over the range (addr, addr + len), and
     locks the pages into memory.  Associated with each	locked page is a
     counter which is incremented each time the	page is	locked.	 The superuser
 can lock as many pages as it wishes, other users are limited to a
     configurable per process maximum.

     munpin decrements the lock	counter	associated with	the pages over the
     range (addr, addr + len).	Pages whose counters are zero are available to
     be	swapped	out at the system's discretion.

     mpin or munpin will fail if one or	more of	the following are true:

     [EINVAL]	    The	addresses specified by (addr, addr + len) are not
		    mapped into	the user's address space.

     [EAGAIN]	    There was insufficient lockable memory to lock the entire
		    address range (addr, addr +	len).  This may	occur even
		    though the amount requested	was less than the systemimposed
 maximum number of locked pages.

     [EBUSY]	    munpin will	fail with this error if	the address range
		    specified has some active I/O initiated by some other
		    process belonging to same share group.

     [ENOMEM]	    The	caller was not super-user and the number of pages to
		    be locked exceeded the per process limit {PLOCK_MAX} [see

     [ENOMEM]	    The	total number of	pages locked by	the caller would
		    exceed the maximum resident	size for the process [see

     [ENOSPC]	    The	address	range (addr, addr + len) contains a memorymapped
 file, and there is insufficient space on the	device
		    to allocate	the entire file.

SEE ALSO    [Toc]    [Back]

     intro(2), getrlimit(2), mlock(3C),	mlockall(3C), plock(2),	ulimit(2).

DIAGNOSTICS    [Toc]    [Back]

     Upon successful completion, mpin and munpin return	0.  Otherwise, a value
     of	-1 is returned and errno is set	to indicate the	error.

									Page 1

MPIN(2)								       MPIN(2)

WARNING    [Toc]    [Back]

     The functions mpin/munpin and mlock/munlock provide similar
     functionality.  The major difference between the two sets is that
     mpin/munpin maintains a per page lock counter and mlock/munlock does not.
     Developers	should choose the set that best	suites their application and
     stick with	it, as mixing the interfaces may result	in unexpected

									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
mlock IRIX lock or unlock pages in memory
mlock OpenBSD lock (unlock) physical pages in memory
mlock FreeBSD lock (unlock) physical pages in memory
mlock NetBSD lock (unlock) physical pages in memory
munlock OpenBSD lock (unlock) physical pages in memory
munlock FreeBSD lock (unlock) physical pages in memory
munlock NetBSD lock (unlock) physical pages in memory
mmap IRIX map pages of memory
mmap HP-UX map pages of memory
munmap IRIX unmap pages of memory
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service