unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Page:
Section:
Apropos / Subsearch:
optional field

MLOCKALL(3)                Library Functions Manual                MLOCKALL(3)



NAME
       mlockall, munlockall - lock (or unlock) address space

SYNOPSIS
       #include <&lt;sys/mman.h>&gt;

       int mlockall(flags)
       int flags;

       int munlockall()

DESCRIPTION
       mlockall()  locks  all pages mapped by an address space in memory.  The
       value of flags determines whether the pages to  be  locked  are  simply
       those  currently mapped by the address space, those that will be mapped
       in the future, or both.  flags is built from  the  options  defined  in
       <&lt;sys/mman.h>&gt; as:

              #define MCL_CURRENT      0x1       /* lock current mappings */
              #define MCL_FUTURE       0x2       /* lock future mappings */

       If  MCL_FUTURE  is specified to mlockall() , then as mappings are added
       to the address space (or existing mappings are replaced) they will also
       be locked, provided sufficient memory is available.

       Mappings  locked  via  mlockall()  with  any  option  may be explicitly
       unlocked with a munlock() call.

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

       All conditions and constraints on the use of locked memory as exist for
       mlock() apply to mlockall() .

RETURN VALUES
       mlockall() and munlockall() return:

       0      on success.

       -1     on failure and set errno to indicate the error.

ERRORS
       EAGAIN         (mlockall() only.)  Some or all of  the  memory  in  the
                      address  space  could  not  be  locked due to sufficient
                      resources.

       EINVAL         flags  contains  values  other  than   MCL_CURRENT   and
                      MCL_FUTURE.

       EPERM          The process's effective user ID is not super-user.

SEE ALSO
       mctl(2), mlock(3), mmap(2)



                                21 January 1990                    MLOCKALL(3)