---
name: "vm_map_madvise"
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_madvise"
---

# vm\_map\_madvise(9)

apply advice about use of memory to map entries

## NAME

**vm\_map\_madvise** – apply advice about use of memory to map entries

## SYNOPSIS

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

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

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

*int*\

**vm\_map\_madvise**(*vm\_map\_t map*, *vm\_offset\_t start*, *vm\_offset\_t end*, *int behav*);

## DESCRIPTION

The **vm\_map\_madvise**() function applies the flags *behav* to the entries within *map* between *start* and *end*.

Advisories are classified as either those affecting the *vm\_map\_entry* structure, or those affecting the underlying objects.

The **vm\_map\_madvise**() function is used by the [madvise(2)](/madvise/2.md) system call.

## RETURN VALUES

The **vm\_map\_madvise**() function returns 0 if successful. If the *behav* argument was not recognised, KERN\_INVALID\_ARGUMENT is returned.

## SEE ALSO

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

## AUTHORS

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