pub unsafe extern "C" fn channel_read(
object_handle: u32,
offset: usize,
buffer: *mut u8,
buffer_len: usize,
) -> isizeExpand description
Perform a non-blocking read from a pending transaction.
Attempts to read up to buf_len bytes from the send_buffer of the
pending transaction starting from offset. The kernel will copy the
data from the initiators send_buffer into buffer before returning.
The maximum size of buffer that may be passed is isize::MAX.
§Returns
>=0: Number of bytes read from the send_buffer.Error::InvalidArgument:object_handleis not a valid handler channel object.Error::OutOfRange: A read was requested outside the bound of the initiator’ssend_buffer.Error::Unavailable: No transaction was pending on the channel. This can happen in the middle of handling a transaction if the initiator cancels the transaction.Error::PermissionDenied:bufferdoes not reference a valid memory region in this processes’ address space.- TODO: What error should be returned if the initiator’s
send_bufferis invalid. Is that also permission denied?