DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

mlockall(S)


mlockall -- lock address space

Synopsis

   #include <sys/mman.h>
   

int mlockall(int flags);

int munlockall(void);

Description

The function mlockall causes all pages mapped by an address space to be locked in memory. The effect of
   mlockall(flags)

is equivalent to:

   memcntl(0, 0, MC_LOCKAS, flags, 0, 0)

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

The function munlockall removes address space locks and locks on mappings in the address space. The effect of munlockall is equivalent to:

   memcntl(0, 0, MC_UNLOCKAS, 0, 0, 0)

Locks established with mlockall are not inherited by a child process after a fork and are not nested.

Return values

Upon successful completion, the functions mlockall and munlockall return 0; otherwise, they return -1 and set errno to indicate the error.

References

fork(S), memcntl(S), mlock(S), mmap(S), plock(S), sysconf(S)

Notices

Use of mlockall and munlockall requires that the user have appropriate privileges.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005