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

  man pages->Tru64 Unix man pages -> mlockall (3)              
Title
Content
Arch
Section
 

mlockall(3)

Contents


NAME    [Toc]    [Back]

       mlockall,  munlockall - Locks into memory, or unlocks, all
       of a specified process's pages (P1003.1b)

SYNOPSIS    [Toc]    [Back]

       #include <sys/mman.h>

       int mlockall ( int options);

       int munlockall (void);


LIBRARY    [Toc]    [Back]

       Realtime Library (librt.so, librt.a)

PARAMETERS    [Toc]    [Back]

       Determines whether the pages to be locked are  those  currently
  mapped  by the process's address space, those that
       will be mapped in the future, or both. The  options  argument
  is  constructed as the OR of one or more of the constants,
 MCL_CURRENT  or  MCL_FUTURE,  as  defined  in  the
       <mman.h> header file.

DESCRIPTION    [Toc]    [Back]

       The  mlockall  function  causes all of the pages mapped by
       the process's address space to be  memory  resident  until
       unlocked  by  a call to the munlockall function, until the
       process exits, or until the process calls  exec.  MCL_CURRENT
 locks all of the pages currently mapped into the process's
 address space. MCL_FUTURE locks all  of  the  pages
       that become mapped into the process's address space in the
       future, when those mappings are established. You can specify
  MCL_CURRENT  and  subsequently  specify MCL_FUTURE to
       lock both current and future address space.

       The munlockall function unlocks all currently mapped pages
       of  the  process's  address  space.  Any pages that become
       mapped into a process's address  space  after  a  call  to
       munlockall  are not locked unless otherwise specified by a
       subsequent call to mlockall. Pages locked or  mapped  into
       another  process's  address  space  are unaffected by this
       process's call to the munlockall function.

       Locking the process's pages into  memory  also  makes  the
       process unswappable.
        When  the  pages  are unlocked, the process is made swappable.


       A lock is not inherited across a fork.  All  memory  locks
       established  on  an address by this process are removed if
       an address range associated with the lock is unmapped with
       a call to the munmap function.

       You  must  have  superuser privileges to call the mlockall
       function.






RETURN VALUES    [Toc]    [Back]

       On a successful call to the mlockall function, a value  of
       0  (zero)  is  returned and memory is locked. On an unsuccessful
 call, a value of -1  is  returned,  no  memory  is
       locked,  and  errno  is  set  to  indicate  that  an error
       occurred.

       On a successful call to the munlockall function,  a  value
       of  0  (zero)  is  returned  and memory is unlocked. On an
       unsuccessful call, a value of -1 is returned and errno  is
       set to indicate that an error occurred.

ERRORS    [Toc]    [Back]

       The  mlockall and munlockall functions fail under the following
 condition: The implementation does not support this
       memory locking interface.

       If  any  of  the  following conditions occur, the mlockall
       function fails: Some or all of the  memory  identified  by
       the  operation could not be locked when the call was made.
       The options argument is  zero  or  includes  unimplemented
       options.   Locking  all of the pages currently mapped into
       the process's address  space  exceeds  an  implementationdefined
 limit on the amount of memory that the process may
       lock.  The calling process does not have  the  appropriate
       privilege to perform the requested operation.

SEE ALSO    [Toc]    [Back]

      
      
       Functions: exec(2), _exit(2), fork(2), munmap(2)

       Guide to Realtime Programming



                                                      mlockall(3)
[ Back ]
 Similar pages
Name OS Title
munlock Tru64 Locks or unlocks a specified region in memory (P1003.1b)
mlock Tru64 Locks or unlocks a specified region in memory (P1003.1b)
sem_post Tru64 Unlocks a semaphore (P1003.1b)
sched_setparam Tru64 Sets the scheduling parameters of the specified process (P1003.1b)
sched_getparam Tru64 Returns the scheduling parameters of the specified process (P1003.1b)
sched_getscheduler Tru64 Returns the scheduling policy of a process (P1003.1b)
nanosleep Tru64 Suspends a process from execution for the specified timer interval (P1003.1b)
sem_open Tru64 Opens/creates a named semaphore for use by a process (P1003.1b)
timer_delete Tru64 Deallocates a previously allocated per-process timer (P1003.1b)
sched_rr_get_interval Tru64 Returns the current quantum for process execution under the SCHED_RR policy (P1003.1b)
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service