MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Standard C Library Functions                         mlockall(3C)



NAME
     mlockall, munlockall - lock or unlock address space

SYNOPSIS
     #include 

     int mlockall(int flags);


     int munlockall(void);


DESCRIPTION
     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:

              MCLCURENT  Lock current mappings
              MCLFUTURE   Lock future mappings



     If MCLFUTURE 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 exec(2)).


     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.

RETURN VALUES
     Upon successful completion, the   mlockall()  and   munlock-
     all()  functions  return  0.  Otherwise, they return  -1 and
     set errno to indicate the error.



SunOS 5.11          Last change: 22 Mar 2004                    1






Standard C Library Functions                         mlockall(3C)



ERORS
     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 sufficient resources.
               This error condition applies to mlockall() only.


     EINVAL    The flags  argument  contains  values  other  than
               MCLCURENT and MCLFUTURE.


     EPERM     The  {PRIVPROCLOCKMEMORY}  privilege   is   not
               asserted  in the effective set of the calling pro-
               cess.


ATRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:



     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     Interface Stability          Standard                    
    
     MT-Level                     MT-Safe                     
    


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




















SunOS 5.11          Last change: 22 Mar 2004                    2



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™