osfmk/man/vm_copy.html
Function - Copy a region of virtual memory.
**kern\_return\_t vm\_copy**** (vm\_task\_t **target\_task,** vm\_address\_t **source\_address,** vm\_size\_t **count,** vm\_address\_t **dest\_address** );**
target_task[in task send right] The port for the task whose memory is to be copied.
source_address[in scalar] The starting address for the source region. The address must be on a page boundary.
count[in scalar] The number of bytes in the source region. The number of bytes must convert to an integral number of virtual pages.
dest_address[in scalar] The starting address for the destination region. The address must be on a page boundary.
The vm_copy function copies a source region to a destination region within the same task's virtual memory. It is semantically equivalent to vm_read followed by vm_write. The destination region can overlap the source region.
The destination region must already be allocated. The source region must be readable, and the destination region must be writable.
This interface is machine word length specific because of the virtual address parameter.
KERN_PROTECTION_FAILURE The source region is protected against reading, or the destination region is protected against writing.
KERN_INVALID_ADDRESS An address is illegal or specifies a non-allocated region, or there is not enough memory following one of the addresses.
Functions: vm_protect, vm_read, vm_write, host_page_size.