OpenSolaris 2009.06 - man page for mlockall (opensolaris section 3C)

Linux & Unix Commands - Search Man Pages

Man Page or Keyword Search:   man
Select Man Page Set:       apropos Keyword Search (sections above)

mlockall(3C)			   Standard C Library Functions 		     mlockall(3C)

       mlockall, munlockall - lock or unlock address space

       #include <sys/mman.h>

       int mlockall(int flags);

       int munlockall(void);

       The mlockall() function locks in memory all pages mapped by an address space.

       The value of flags determines whether the pages to be locked are those currently mapped by
       the address space, those that will be mapped in the future, or both:

		MCL_CURRENT  Lock current mappings
		MCL_FUTURE   Lock future mappings

       If MCL_FUTURE is specified for mlockall(), mappings are locked as they are  added  to  the
       address	space  (or  replace  existing mappings), provided sufficient memory is available.
       Locking in this manner is  not  persistent  across  the	exec  family  of  functions  (see

       Mappings  locked  using	mlockall()  with  any  option  may  be explicitly unlocked with a
       munlock() call (see mlock(3C)).

       The  munlockall() function removes address space  locks	and  locks  on	mappings  in  the
       address space.

       All  conditions	and  constraints on the use of locked memory that apply to mlock(3C) also
       apply to mlockall().

       Locks established with mlockall() are not inherited by a child process  after  a   fork(2)
       call, and are not nested.

       Upon  successful completion, the  mlockall() and  munlockall() functions return 0.  Other-
       wise, they return  -1 and set errno to indicate the error.

       The mlockall() and munlockall() functions will fail if:

       EAGAIN	 Some or all of the memory in the address space could not be locked due to suffi-
		 cient resources. This error condition applies to mlockall() only.

       EINVAL	 The flags argument contains values other than MCL_CURRENT and MCL_FUTURE.

       EPERM	 The  {PRIV_PROC_LOCK_MEMORY}  privilege  is not asserted in the effective set of
		 the calling process.

       See attributes(5) for descriptions of the following attributes:

       |      ATTRIBUTE TYPE	     |	    ATTRIBUTE VALUE	   |
       |Interface Stability	     |Standard			   |
       |MT-Level		     |MT-Safe			   |

       exec(2), fork(2), memcntl(2), mmap(2), plock(3C), mlock(3C),  sysconf(3C),  attributes(5),

SunOS 5.11				   22 Mar 2004				     mlockall(3C)
Unix & Linux Commands & Man Pages : ©2000 - 2018 Unix and Linux Forums

All times are GMT -4. The time now is 11:19 PM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
Show Password

Not a Forum Member?
Forgot Password?