4 <strong>Function
</strong> - Copy a region of virtual memory.
7 <strong>kern_return_t vm_copy
</strong>
8 <strong>(vm_task_t
</strong> <var>target_task
</var>,
9 <strong>vm_address_t
</strong> <var>source_address
</var>,
10 <strong>vm_size_t
</strong> <var>count
</var>,
11 <strong>vm_address_t
</strong> <var>dest_address
</var><strong>);
</strong>
16 <dt> <var>target_task
</var>
19 The port for the task whose memory is to be copied.
21 <dt> <var>source_address
</var>
24 The starting address for the source region. The address must
25 be on a page boundary.
30 The number of bytes in the source region. The number of
31 bytes must convert to an integral number of virtual pages.
33 <dt> <var>dest_address
</var>
36 The starting address for the destination region. The address
37 must be on a page boundary.
41 The
<strong>vm_copy
</strong> function copies a source region to a destination
43 same task's virtual memory. It is semantically equivalent to
44 <strong>vm_read
</strong> followed
45 by
<strong>vm_write
</strong>. The destination region can overlap the source region.
47 The destination region must already be allocated. The source region must be
48 readable, and the destination region must be writable.
51 This interface is machine word length specific because of the virtual address
53 <h3>RETURN VALUES
</h3>
56 <dt> <strong>KERN_PROTECTION_FAILURE
</strong>
58 The source region is protected against reading, or the destination
59 region is protected against writing.
61 <dt> <strong>KERN_INVALID_ADDRESS
</strong>
63 An address is illegal or specifies a non-allocated region, or there is not
64 enough memory following one of the addresses.
66 <h3>RELATED INFORMATION
</h3>
69 <a href=
"vm_protect.html"><strong>vm_protect
</strong></a>,
70 <a href=
"vm_read.html"><strong>vm_read
</strong></a>,
71 <a href=
"vm_write.html"><strong>vm_write
</strong></a>,
72 <a href=
"host_page_size.html"><strong>host_page_size
</strong></a>.