devela::sys::os::linux::io

Function linux_sys_read

Source
pub unsafe fn linux_sys_read(fd: c_int, buf: *mut u8, count: usize) -> isize 
Available on crate features unsafe_syscall and linux only.
Expand description

Performs a read syscall.

Read count bytes from a file descriptor fd into a buffer buf.

§Info

§Example

use devela::{linux_sys_read, LINUX_FILENO};

let mut buf: [u8; 1024] = [0; 1024];
let bytes_read: isize = unsafe {
    linux_sys_read(LINUX_FILENO::STDIN, buf.as_mut_ptr(), buf.len())
};
assert![bytes_read > 0];

§Safety

TODO