NAME
vm_copy - copies memory to a destination address

SYNOPSIS
#include <mach.h>

kern_return_t vm_copy (target_task, source_address, count, dest_address)
vm_task_t target_task;
vm_address_t source_address;
vm_size_t count;
vm_address_t dest_address;

ARGUMENTS
target_task Task whose virtual memory is to be affected.

source_address Address in target_task of the start of the source
range (must be a page boundary).

count Number of bytes to copy (must be an integral number
of pages).

dest_address Address in target_task of the start of the
destination range (must be a page boundary).

DESCRIPTION
vm_copy causes the source memory range to be copied to the
destination address; the destination region may not overlap the
source region. The destination address range must already be
allocated and writable; the source range must be readable.

DIAGNOSTICS
KERN_SUCCESS Memory copied.

KERN_INVALID_ARGUMENT Either the address does not start on
a page boundary or the size is not an
integral number of pages.

KERN_PROTECTION_FAILURE Either the destination region was not
not writable, or the source region
was not readable.

KERN_INVALID_ADDRESS Illegal or non-allocated address
specified or insufficient memory
allocated at one of the addresses.

SEE ALSO
vm_protect(2), vm_write(2), vm_statistics(2)