---
name: "vm_page_grab"
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_page_grab"
---

# vm\_page\_grab(9)

returns a page from an object

## NAME

**vm\_page\_grab** – returns a page from an object

## SYNOPSIS

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

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

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

*vm\_page\_t*\

**vm\_page\_grab**(*vm\_object\_t object*, *vm\_pindex\_t pindex*, *int allocflags*);

## DESCRIPTION

The **vm\_page\_grab**() function returns the page at *pindex* from the given object. If the page exists and is busy, **vm\_page\_grab**() will sleep while waiting for it. If the page does not exist, it is allocated.

If VM\_ALLOC\_RETRY is not set in *allocflags* and the function sleeps, either getting the page from the object or while allocating it, NULL is returned.

## RETURN VALUES

If successful, **vm\_page\_grab**() returns the page; otherwise, NULL is returned.

## SEE ALSO

[vm\_page\_alloc(9)](/vm_page_alloc/9.md)

## AUTHORS

This manual page was written by Chad David ⟨davidc@acns.ab.ca⟩.
