]> git.saurik.com Git - apple/xnu.git/blame - osfmk/man/vm_write.html
xnu-792.21.3.tar.gz
[apple/xnu.git] / osfmk / man / vm_write.html
CommitLineData
13fec989
A
1<h2>vm_write</h2>
2<hr>
3<p>
4<strong>Function</strong> - Write data to the specified address in the target task's address space.
5<h3>SYNOPSIS</h3>
6<pre>
7<strong>kern_return_t vm_write</strong>
8 <strong>(vm_task_t</strong> <var>target_task</var>,
9 <strong>vm_address_t</strong> <var>address</var>,
10 <strong>pointer_t</strong> <var>data</var>,
11 <strong>mach_msg_type_number_t</strong> <var>data_count</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
20written.
21<p>
22<dt> <var>address</var>
23<dd>
24[in scalar]
25The address at which to start the write.
26<p>
27<dt> <var>data</var>
28<dd>
29[pointer to page aligned in array of bytes]
30An array of data to be
31written.
32<p>
33<dt> <var>data_count</var>
34<dd>
35[in scalar]
36The number of bytes in the array.
37</dl>
38<h3>DESCRIPTION</h3>
39<p>
40The <strong>vm_write</strong> function writes an array of data to a
41task's virtual memory. It
42allows one task to write to another task's memory.
43<p>
44The result of <strong>vm_write</strong> is as if <var>target_task</var> had directly
45written into the set of
46pages. Hence, <var>target_task</var> must have write permission to the pages.
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>
56Specified memory is valid, but does not permit writing.
57<p>
58<dt> <strong>KERN_INVALID_ADDRESS</strong>
59<dd>
60The address is illegal or specifies a non-allocated region.
61</dl>
62<h3>RELATED INFORMATION</h3>
63<p>
64Functions:
65<a href="vm_copy.html"><strong>vm_copy</strong></a>,
66<a href="vm_protect.html"><strong>vm_protect</strong></a>,
67<a href="vm_read.html"><strong>vm_read</strong></a>,
68<a href="host_page_size.html"><strong>host_page_size</strong></a>.