munlock man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]



mlock(3C)							     mlock(3C)

NAME
     mlock, munlock - lock or unlock pages in memory

SYNOPSIS
     #include <sys/types.h>
     #include <sys/mman.h>
     int mlock(const void *addr, size_t len);
     int munlock(const void *addr, size_t len);

DESCRIPTION
     mlock locks the pages associated with the address range (addr, addr +
     len) into memory.	The super-user can lock as many pages as it wishes,
     other users are limited to a per process maximum {PLOCK_MAX}. Locks
     established with mlock are not inherited by a child process after a fork.

     munlock unlocks the pages associated with the address range (addr, addr +
     len), regardless of the number of times the pages were locked. Page locks
     established by other processes are unaffected, when the pages are shared
     amongst multiple processes.

     Address addr is not required to be page aligned, as the system
     automatically rounds the address down to the nearest page boundary.

     mlock or munlock will fail if one or more of the following are true:

     [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 system-imposed maximum
		 number of locked pages.

     [EBUSY]	 munlock 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 addresses specified by (addr, addr + len) are not mapped
		 into the user's address space.

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

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

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

									Page 1

mlock(3C)							     mlock(3C)

SEE ALSO
     exec(2), exit(2), fork(2), mlockall(3C), munlockall(3C), mmap(2),
     mpin(2), munpin(2), plock(2)

DIAGNOSTICS
     Upon successful completion, the functions mlock and munlock return 0,
     otherwise, they return -1 and set errno to indicate the error.

WARNING
     The functions mlock/munlock and mpin/munpin 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
     behavior.

									Page 2

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net