int mlock(const void *addr, size_t size);
This system call implements the POSIX.1b mlock function, which locks down a range of a program's memory so that page faults will not occur in that area. This is needed by programs with real-time requirements, or when installing ``fast'' (non-signal-based) hardware interrupt handlers.
Neither the start address of the specified region nor its length need to be page-aligned; this function will lock all pages overlapping the specified region.
- The start address of the region to lock.
- The size of the region to lock, in bytes.
Returns 0 if successful, or -1 on error, in which case errno indicates the error.