Function - Set a VM region's inheritance attribute.
kern_return_t vm_inherit (vm_task_t target_task, vm_address_t address, vm_size_t size, vm_inherit_t new_inheritance);
The vm_inherit function sets the inheritance attribute for a region within the specified task's address space. The inheritance attribute determines the type of access established for child tasks at task creation.
Because inheritance applies to virtual pages, the specified address and size are rounded to page boundaries, as follows: the region starts at the beginning of the virtual page containing address; it ends at the end of the virtual page containing address + size - 1. Because of this rounding to virtual page boundaries, the amount of memory affected may be greater than size. Use host_page_size to find the current virtual page size.
A parent and a child task can share the same physical memory only if the inheritance for the memory is set to VM_INHERIT_SHARE before the child task is created. Other than through the use of an external memory manager (see vm_map), this is the only way that two tasks can share memory.
Note that all the threads within a task share the task's memory.
This interface is machine word length specific because of the virtual address parameter.
Functions: task_create, vm_map, vm_region, norma_task_create.