---
name: "vm_map_inherit"
section: "9"
platform: "linux"
package: "freebsd-manpages"
version: "6.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/vm_map_inherit"
---

# vm\_map\_inherit(9)

set fork inheritance flags for a range within a map

## NAME

**vm\_map\_inherit** – set fork inheritance flags for a range within a map

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<vm/vm.h\>**

**#include \<vm/vm\_map.h\>**

*int*\

**vm\_map\_inherit**(*vm\_map\_t map*, *vm\_offset\_t start*, *vm\_offset\_t end*, *vm\_inherit\_t new\_inheritance*);

## 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)](/vm_map_lock/9.md) for the duration of the function.

## 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)](/fork/2.md)

## AUTHORS

This manual page was written by Bruce M Simpson ⟨bms@spc.org⟩.
