4 <strong>Function
</strong> - Write a sequence of bytes to a specific device.
7 <strong>#include<device/device.h>
</strong>
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>
19 <strong>#include<device/device_request.h>
</strong>
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>
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>
38 <dt> <var>device
</var>
40 [in device send right]
41 A device port to the device to be written.
43 <dt> <var>reply_port
</var>
45 [in reply receive (to be converted to send-once) right]
47 which the reply message is to be sent.
52 I/O mode value. Meaningful options are:
55 <dt> <strong>D_NOWAIT
</strong>
57 Do not wait for I/O completion.
60 <dt> <var>recnum
</var>
63 Record number to be written.
67 [pointer to in array of bytes]
68 Data bytes to be written.
70 <dt> <var>data_count
</var>
73 Number of data bytes to be written.
75 <dt> <var>return_code
</var>
78 The return status code from the write.
80 <dt> <var>bytes_written
</var>
82 [out scalar, in for asynchronous form]
83 Size of data transfer.
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
91 <h3>RETURN VALUES
</h3>
93 Only generic errors apply.
94 <h3>RELATED INFORMATION
</h3>
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>.