next up previous contents
Next: mmap: map a file's Up: MOSS system calls Previous: mlock: lock a region

mlockall: lock all memory

SYNOPSIS

int mlockall(int flags);

DESCRIPTION

This system call implements the POSIX.1b mlockall function, which locks down all of a program's memory. The flags argument specifies whether to lock down memory the program has already allocated (MCL_CURRENT), memory the program allocates in the future (MCL_FUTURE), or both (MCL_CURRENT | MCL_FUTURE).

MOSS currently only supports MCL_FUTURE; attempting to call mlockall with MCL_CURRENT set will cause the DOS extender to panic. (MCL_CURRENT isn't hard to implement; we just haven't done it yet.)

Also, note that munlockall is currently unimplemented.

PARAMETERS

flags
The flags specifying whether to lock down currently allocated memory, memory allocated in the future, or both.

RETURN VALUE

Returns 0 if successful, or -1 on error, in which case errno indicates the error.



Bryan Ford