]> git.saurik.com Git - apple/xnu.git/blame - osfmk/man/vm_copy.html
xnu-792.6.70.tar.gz
[apple/xnu.git] / osfmk / man / vm_copy.html
CommitLineData
9bccf70c 1<h2>vm_copy</h2>\r<hr>\r<p>\r<strong>Function</strong> - Copy a region of virtual memory.\r<h3>SYNOPSIS</h3>\r<pre>\r<strong>kern_return_t vm_copy</strong>\r <strong>(vm_task_t</strong> <var>target_task</var>,\r <strong>vm_address_t</strong> <var>source_address</var>,\r <strong>vm_size_t</strong> <var>count</var>,\r <strong>vm_address_t</strong> <var>dest_address</var><strong>);</strong>\r</pre>\r<h3>PARAMETERS</h3>\r<dl>\r<p>\r<dt> <var>target_task</var> \r<dd>\r[in task send right]\rThe port for the task whose memory is to be copied.\r<p>\r<dt> <var>source_address</var> \r<dd>\r[in scalar]\rThe starting address for the source region. The address must \rbe on a page boundary.\r<p>\r<dt> <var>count</var> \r<dd>\r[in scalar]\rThe number of bytes in the source region. The number of \rbytes must convert to an integral number of virtual pages.\r<p>\r<dt> <var>dest_address</var> \r<dd>\r[in scalar]\rThe starting address for the destination region. The address \rmust be on a page boundary.\r</dl>\r<h3>DESCRIPTION</h3>\r<p>\rThe <strong>vm_copy</strong> function copies a source region to a destination\rregion within the \rsame task's virtual memory. It is semantically equivalent to\r<strong>vm_read</strong> followed \rby <strong>vm_write</strong>. The destination region can overlap the source region.\r<p>\rThe destination region must already be allocated. The source region must be \rreadable, and the destination region must be writable.\r<h3>NOTES</h3>\r<p>\rThis interface is machine word length specific because of the virtual address\rparameter.\r<h3>RETURN VALUES</h3>\r<dl>\r<p>\r<dt> <strong>KERN_PROTECTION_FAILURE</strong>\r<dd>\rThe source region is protected against reading, or the destination\rregion is protected against writing.\r<p>\r<dt> <strong>KERN_INVALID_ADDRESS</strong>\r<dd>\rAn address is illegal or specifies a non-allocated region, or there is not \renough memory following one of the addresses.\r</dl>\r<h3>RELATED INFORMATION</h3>\r<p>\rFunctions:\r<a href="vm_protect.html"><strong>vm_protect</strong></a>,\r<a href="vm_read.html"><strong>vm_read</strong></a>,\r<a href="vm_write.html"><strong>vm_write</strong></a>,\r<a href="host_page_size.html"><strong>host_page_size</strong></a>.\r