]> git.saurik.com Git - apple/xnu.git/blob - osfmk/man/vm_write.html
xnu-2422.1.72.tar.gz
[apple/xnu.git] / osfmk / man / vm_write.html
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]
19 The port for the task whose memory is to be
20 written.
21 <p>
22 <dt> <var>address</var>
23 <dd>
24 [in scalar]
25 The 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]
30 An array of data to be
31 written.
32 <p>
33 <dt> <var>data_count</var>
34 <dd>
35 [in scalar]
36 The number of bytes in the array.
37 </dl>
38 <h3>DESCRIPTION</h3>
39 <p>
40 The <strong>vm_write</strong> function writes an array of data to a
41 task's virtual memory. It
42 allows one task to write to another task's memory.
43 <p>
44 The result of <strong>vm_write</strong> is as if <var>target_task</var> had directly
45 written into the set of
46 pages. Hence, <var>target_task</var> must have write permission to the pages.
47 <h3>NOTES</h3>
48 <p>
49 This interface is machine word length specific because of the virtual address
50 parameter.
51 <h3>RETURN VALUES</h3>
52 <dl>
53 <p>
54 <dt> <strong>KERN_PROTECTION_FAILURE</strong>
55 <dd>
56 Specified memory is valid, but does not permit writing.
57 <p>
58 <dt> <strong>KERN_INVALID_ADDRESS</strong>
59 <dd>
60 The address is illegal or specifies a non-allocated region.
61 </dl>
62 <h3>RELATED INFORMATION</h3>
63 <p>
64 Functions:
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>.