NAME
vm_inherit - specifies inheritance of address space

SYNOPSIS
#include <mach.h>

kern_return_t vm_inherit(target_task, address, size, new_inheritance)
vm_task_t target_task;
vm_address_t address;
vm_size_t size;
vm_inherit_t new_inheritance;

ARGUMENTS
target_task Task whose virtual memory is to be affected.

address Starting address (will be rounded down to a
page boundary).

size Size in bytes of the region for which
inheritance is to change (will be rounded up
to give a page boundary).

new_inheritance How this memory is to be inherited in child
tasks. Inheritance is specified by using one
of these following three values:

VM_INHERIT_SHARE Child tasks will share this memory with this
task.

VM_INHERIT_COPY Child tasks will receive a copy of this
region.

VM_INHERIT_NONE This region will be absent from child tasks.

DESCRIPTION
vm_inherit specifies how a region of a task’s address space is to
be passed to child tasks at the time of task creation. Inheritance
is an attribute of virtual pages, thus the addresses and size of
memory to be set will be rounded out to refer to whole pages.

Setting vm_inherit to VM_INHERIT_SHARE and forking a child task is
the only way two Mach tasks can share physical memory. Remember
that all the theads of a given task share all the same memory.

DIAGNOSTICS
KERN_SUCCESS Memory protected.

KERN_INVALID_ADDRESS Illegal address specified.

SEE ALSO
task_create(2), vm_region(2)