]> git.saurik.com Git - apple/xnu.git/blob - osfmk/man/device_write.html
xnu-792.6.76.tar.gz
[apple/xnu.git] / osfmk / man / device_write.html
1 <h2>device_write</h2>
2 <hr>
3 <p>
4 <strong>Function</strong> - Write a sequence of bytes to a specific device.
5 <h3>SYNOPSIS</h3>
6 <pre>
7 <strong>#include&ltdevice/device.h&gt</strong>
8
9 <strong>kern_return_t device_write</strong>
10 <strong>(device_t</strong> <var>device</var>,
11 <strong>mach_port_t</strong> <var>reply_port</var>,
12 <strong>dev_mode_t</strong> <var>mode</var>,
13 <strong>recnum_t</strong> <var>recnum</var>,
14 <strong>io_buf_ptr_t</strong> <var>data</var>,
15 <strong>mach_msg_type_number_t</strong> <var>data_count</var>,
16 <strong>io_buf_len_t</strong> <var>io_buf_len_t</var><strong>);</strong>
17
18
19 <strong>#include&ltdevice/device_request.h&gt</strong>
20
21 <strong>kern_return_t device_write_request</strong>
22 <strong>(mach_port_t</strong> <var>device</var>,
23 <strong>mach_port_t</strong> <var>reply_port</var>,
24 <strong>dev_mode_t</strong> <var>mode</var>,
25 <strong>recnum_t</strong> <var>recnum</var>,
26 <strong>io_buf_ptr_t</strong> <var>data</var>,
27 <strong>mach_msg_type_number_t</strong> <var>data_count</var><strong>);</strong>
28
29
30 <strong>kern_return_t ds_device_write_reply</strong>
31 <strong>(mach_port_t</strong> <var>reply_port</var>,
32 <strong>kern_return_t</strong> <var>return_code</var>,
33 <strong>io_buf_len_t</strong> <var>bytes_written</var><strong>);</strong>
34 </pre>
35 <h3>PARAMETERS</h3>
36 <dl>
37 <p>
38 <dt> <var>device</var>
39 <dd>
40 [in device send right]
41 A device port to the device to be written.
42 <p>
43 <dt> <var>reply_port</var>
44 <dd>
45 [in reply receive (to be converted to send-once) right]
46 The port to
47 which the reply message is to be sent.
48 <p>
49 <dt> <var>mode</var>
50 <dd>
51 [in scalar]
52 I/O mode value. Meaningful options are:
53 <dl>
54 <p>
55 <dt> <strong>D_NOWAIT</strong>
56 <dd>
57 Do not wait for I/O completion.
58 </dl>
59 <p>
60 <dt> <var>recnum</var>
61 <dd>
62 [in scalar]
63 Record number to be written.
64 <p>
65 <dt> <var>data</var>
66 <dd>
67 [pointer to in array of bytes]
68 Data bytes to be written.
69 <p>
70 <dt> <var>data_count</var>
71 <dd>
72 [in scalar]
73 Number of data bytes to be written.
74 <p>
75 <dt> <var>return_code</var>
76 <dd>
77 [in scalar]
78 The return status code from the write.
79 <p>
80 <dt> <var>bytes_written</var>
81 <dd>
82 [out scalar, in for asynchronous form]
83 Size of data transfer.
84 </dl>
85 <h3>DESCRIPTION</h3>
86 <p>
87 The <strong>device_write</strong> function writes a sequence of bytes
88 to a device object. The
89 meaning of <var>recnum</var> as well as the specific operation performed is device
90 dependent.
91 <h3>RETURN VALUES</h3>
92 <p>
93 Only generic errors apply.
94 <h3>RELATED INFORMATION</h3>
95 <p>
96 Functions:
97 <a href="device_write_inband.html"><strong>device_write_inband</strong></a>,
98 <a href="device_reply_server.html"><strong>device_reply_server</strong></a>.