]> git.saurik.com Git - apple/xnu.git/blame - osfmk/man/vm_read.html
xnu-344.tar.gz
[apple/xnu.git] / osfmk / man / vm_read.html
CommitLineData
9bccf70c 1<h2>vm_read</h2>\r<hr>\r<p>\r<strong>Function</strong> - Read the specified range of target task's address space.\r<h3>SYNOPSIS</h3>\r<pre>\r<strong>kern_return_t vm_read</strong>\r <strong>(vm_task_t</strong> <var>target_task</var>,\r <strong>vm_address_t</strong> <var>address</var>,\r <strong>vm_size_t</strong> <var>size</var>,\r <strong>size</strong> <var>data_out</var>,\r <strong>target_task</strong> <var>data_count</var><strong>);</strong>\r</pre>\r\r<h4>Overwrite form:</h4>\r<pre>\r<strong>kern_return_t vm_read_overwrite</strong>\r <strong>(vm_task_t</strong> <var>target_task</var>,\r <strong>vm_address_t</strong> <var>address</var>,\r <strong>vm_size_t</strong> <var>size</var>,\r <strong>pointer_t</strong> <var>data_in</var>,\r <strong>target_task</strong> <var>data_count</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 read.\r<p>\r<dt> <var>address</var> \r<dd>\r[in scalar]\rThe address at which to start the read.\r<p>\r<dt> <var>size</var> \r<dd>\r[in scalar]\rThe number of bytes to read.\r<p>\r<dt> <var>data_out</var>\r<dd>\rOut-pointer to dynamic array of bytes returned by the read.\r<p>\r<dt> <var>data_in</var>\r<dd>\rIn-pointer to array of bytes that will be overwritten with the data returned by the read.\r<p>\r<dt> <var>data_count</var> \r<dd>\r[in/out scalar]\rOn input, the maximum size of the buffer; on output, the \rsize returned (in natural-sized units).\r</dl>\r<h3>DESCRIPTION</h3>\r<p>\rThe <strong>vm_read</strong> and <strong>vm_read_overwrite</strong>\rfunctions read a portion of a task's virtual\rmemory (they enable tasks to read other tasks' memory).\rThe <strong>vm_read</strong> function returns the data in a dynamically\rallocated array of bytes; the <strong>vm_read_overwrite</strong> function\rplaces the data into a caller-specified buffer (the <var>data_in</var>\rparameter).\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>\rSpecified memory is valid, but does not permit reading.\r<p>\r<dt> <strong>KERN_INVALID_ADDRESS</strong>\r<dd>\rThe address is illegal or specifies a non-allocated region, or there are \rless than <var>size</var> bytes of data following the address, or the region\rspecified by the <var>data_in</var> parameter cannot be written to.\r</dl>\r<h3>RELATED INFORMATION</h3>\r<p>\rFunctions:\r<a href="vm_copy.html"><strong>vm_copy</strong></a>,\r<a href="vm_deallocate.html"><strong>vm_deallocate</strong></a>,\r<a href="vm_write.html"><strong>vm_write</strong></a>.\r