NAME
vm_region - returns information about regions of a task’s address space

SYNOPSIS
#include <mach.h>

kern_return_t vm_region(target_task, address, size, protection, max_protection,
inheritance, shared, object_name, offset)
vm_task_t target_task;
vm_address_t *address; /* in/out */
vm_size_t *size; /* out */
vm_prot_t *protection; /* out */
vm_prot_t *max_protection; /* out */
vm_inherit_t *inheritance; /* out */
boolean_t *shared; /* out */
port_t *object_name; /* out */
vm_offset_t *offset; /* out */

ARGUMENTS
target_task The task for which an address space description is
requested.

address The address at which to start looking for a region.

size The size (in bytes) of the located region.

protection The current protection of the region.

max_protection The maximum allowable protection for this region.

inheritance The inheritance attribute for this region.

shared Is this region shared or not.

object_name The port identifying the memory object associated
with this region. (See pager_init.)

offset The offset into the pager object that this region
begins at.

DESCRIPTION
vm_region returns a description of the specified region of the
target task’s virtual address space. vm_region begins at address
and looks forward thru memory until it comes to an allocated
region. (If address is within a region, then that region is used.)
Various bits of information about the region are returned. If
address was not within a region, then address is set to the start
of the first region which follows the incoming value. In this way
an entire address space can be scanned.

DIAGNOSTICS
KERN_SUCCESS Region located and information returned.

KERN_NO_SPACE There is no region at or above address in the
specified task.

SEE ALSO
vm_allocate(2), vm_deallocate(2), vm_protect(2), vm_inherit(2)