4 <strong>Function
</strong> - Read a sequence of bytes from a specific device.
7 <strong>#include<device/device.h>
</strong>
9 <strong>kern_return_t device_read
</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_len_t
</strong> <var>bytes_wanted
</var>,
15 <strong>io_buf_ptr_t
</strong> <var>io_buf_ptr_t
</var>,
16 <strong>mach_msg_type_number_t
</strong> <var>mach_msg_type_number_t
</var><strong>);
</strong>
19 <strong>#include<device/device_request.h>
</strong>
21 <strong>kern_return_t device_read_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_len_t
</strong> <var>bytes_wanted
</var><strong>);
</strong>
30 <strong>kern_return_t ds_device_read_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_ptr_t
</strong> <var>data
</var>,
34 <strong>mach_msg_type_number_t
</strong> <var>data_count
</var><strong>);
</strong>
39 <dt> <var>device
</var>
41 [in device send right]
42 A device port to the device to be read.
44 <dt> <var>reply_port
</var>
46 [in reply receive (to be converted to send-once) right]
48 which the reply message is to be sent.
53 I/O mode value. Meaningful options are:
56 <dt> <strong>D_NOWAIT
</strong>
58 Do not wait if data is unavailable.
61 <dt> <var>recnum
</var>
64 Record number to be read.
66 <dt> <var>bytes_wanted
</var>
69 Size of data transfer.
71 <dt> <var>return_code
</var>
74 The return status code from the read.
78 [out pointer to dynamic array of bytes, in for asynchronous form]
81 <dt> <var>data_count
</var>
83 [out scalar, in for asynchronous form]
84 Number of returned data bytes.
88 The
<strong>device_read
</strong> function reads a sequence of bytes
89 from a device object. The
90 meaning of
<var>recnum
</var> as well as the specific operation performed is device
92 <h3>RETURN VALUES
</h3>
94 Only generic errors apply.
95 <h3>RELATED INFORMATION
</h3>
98 <a href=
"device_read_inband.html"><strong>device_read_inband
</strong></a>,
99 <a href=
"device_read_overwrite.html"><strong>device_read_overwrite
</strong></a>,
100 <a href=
"device_reply_server.html"><strong>device_reply_server
</strong></a>.