vm_map_inherit — set fork inheritance flags for a range within a map
Contents
Description
The vm_map_inherit() function sets the inheritance flags for the range start to end within the target map
to the value new_inheritance.
The new_inheritance flag must have one of the values VM_INHERIT_NONE, VM_INHERIT_COPY, or
VM_INHERIT_SHARE. This affects how the map will be shared with child maps when the associated process
forks.
Implementation Notes
The vm_map_inherit() function obtains a lock on the map using vm_map_lock(9) for the duration of the
function.
Name
vm_map_inherit — set fork inheritance flags for a range within a map
Return Values
The vm_map_inherit() function returns KERN_SUCCESS if the inheritance flags could be set. Otherwise, if
the provided flags were invalid, KERN_INVALID_ARGUMENT will be returned.
See Also
fork(2)
Synopsis
#include<sys/param.h>#include<vm/vm.h>#include<vm/vm_map.h>intvm_map_inherit(vm_map_tmap, vm_offset_tstart, vm_offset_tend, vm_inherit_tnew_inheritance);
