1<h2>vm_copy</h2> 2<hr> 3<p> 4<strong>Function</strong> - Copy a region of virtual memory. 5<h3>SYNOPSIS</h3> 6<pre> 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> 12</pre> 13<h3>PARAMETERS</h3> 14<dl> 15<p> 16<dt> <var>target_task</var> 17<dd> 18[in task send right] 19The port for the task whose memory is to be copied. 20<p> 21<dt> <var>source_address</var> 22<dd> 23[in scalar] 24The starting address for the source region. 25<p> 26<dt> <var>count</var> 27<dd> 28[in scalar] 29The number of bytes in the source region. The number of 30bytes must convert to an integral number of virtual pages. 31<p> 32<dt> <var>dest_address</var> 33<dd> 34[in scalar] 35The starting address for the destination region. 36</dl> 37<h3>DESCRIPTION</h3> 38<p> 39The <strong>vm_copy</strong> function copies a source region to a destination 40region within the 41same task's virtual memory. It is semantically equivalent to 42<strong>vm_read</strong> followed 43by <strong>vm_write</strong>. The destination region can overlap the source region. 44<p> 45The destination region must already be allocated. The source region must be 46readable, and the destination region must be writable. 47<h3>NOTES</h3> 48<p> 49This interface is machine word length specific because of the virtual address 50parameter. 51<h3>RETURN VALUES</h3> 52<dl> 53<p> 54<dt> <strong>KERN_PROTECTION_FAILURE</strong> 55<dd> 56The source region is protected against reading, or the destination 57region is protected against writing. 58<p> 59<dt> <strong>KERN_INVALID_ADDRESS</strong> 60<dd> 61An address is illegal or specifies a non-allocated region, or there is not 62enough memory following one of the addresses. 63</dl> 64<h3>RELATED INFORMATION</h3> 65<p> 66Functions: 67<a href="vm_protect.html"><strong>vm_protect</strong></a>, 68<a href="vm_read.html"><strong>vm_read</strong></a>, 69<a href="vm_write.html"><strong>vm_write</strong></a>, 70<a href="host_page_size.html"><strong>host_page_size</strong></a>. 71