---
name: "vm_map_lookup"
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_lookup"
---

# vm\_map\_lookup(9)

lookup the vm\_object backing a given virtual region

## NAME

**vm\_map\_lookup**, **vm\_map\_lookup\_done** – lookup the vm\_object backing a given virtual region

## SYNOPSIS

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

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

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

*int*\

**vm\_map\_lookup**(*vm\_map\_t \*var\_map*, *vm\_offset\_t vaddr*, *vm\_prot\_t fault\_type*, *vm\_map\_entry\_t \*out\_entry*, *vm\_object\_t \*object*, *vm\_pindex\_t \*pindex*, *vm\_prot\_t \*out\_prot*, *boolean\_t \*wired*);

*void*\

**vm\_map\_lookup\_done**(*vm\_map\_t map*, *vm\_map\_entry\_t entry*);

## DESCRIPTION

The **vm\_map\_lookup**() function attempts to find the *vm\_object*, page index and protection, for the given virtual address *vaddr*, in the map *var\_map*, assuming a page fault of the type *fault\_type* had occurred.

Return values are guaranteed until **vm\_map\_lookup\_done**() is called to release the lock.

## IMPLEMENTATION NOTES

The function **vm\_map\_lookup**() acquires a read-lock on the map *\*var\_map*, but does not release it. The caller should invoke **vm\_map\_lookup\_done**() in order to release this lock.

## RETURN VALUES

The **vm\_map\_lookup**() function returns KERN\_SUCCESS, and sets the *\*object*, *\*pindex*, *\*out\_prot*, and *\*out\_entry* arguments appropriately for the hypothetical page fault.

## SEE ALSO

[vm\_map(9)](/vm_map/9.md)

## AUTHORS

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