sys_read_words

Function sys_read_words 

Source
pub unsafe extern "C" fn sys_read_words(
    fd: u32,
    recv_ptr: *mut u32,
    nwords: usize,
) -> usize
Expand description

Reads up to the given number of words into the buffer [recv_buf, recv_buf + nwords). Returns the number of bytes actually read. sys_read_words is a more efficient interface than sys_read, but varies from POSIX semantics. Notably:

  • The read length is specified in words, not bytes. (The output length is still returned in bytes)

  • If not all data is available, sys_read_words will return a short read.

  • recv_buf must be word-aligned.

  • Return a short read in the case of EOF mid-way through.

§Safety

recv_ptr' must be a word-aligned pointer and point to a region of nwords’ size.