mctl()

NAME

mctl() - control memory management

SYNOPSIS

#include <sys/mman.h>

mctl(void *addr, size_t len, int cmd, int arg)

DESCRIPTION

The mctl(3) call controls the management of memory for the pages mapped in the range [addr, addr + len]. The actual management command is specified by cmd, which can be one of:

M

The mctl(3) call is actually an historical version of memcntl(2); it is equivalent to:

memcntl(addr, len, cmd, (void *)arg

See the memcntl(2) man page for more information.

RETURN VALUES

The mctl(3) call returns 0 on success and -1 on failure. On failure, it sets the value of errno to indicate the error.

ERRORS

The mctl(3) call can fail for the following reasons:

[EAGAIN]
Insufficient resources to lock some or all of the memory.
[EBUSY]
One of the pages is locked in memory and MS_INVALIDATE was the command.
[EINVAL]
The addr is invalid. It must be a multiple of the page size.
[EIO]
An I/O error occurred.
[ENOMEM]
The addresses in the range are not valid for the address space of the process, or are for pages that aren't mapped.
[EPERM]
A locking command was specified and the effective user ID does not have appropriate privileges.

SEE ALSO

memcntl(2)