devela::allFunction linux_get_line
Source pub fn linux_get_line<const CAP: usize>(buffer: &mut [u8; CAP]) -> &str ⓘ
Available on crate features unsafe_syscall
and linux
only.
Expand description
Gets a string from stdin backed by a buffer
, until a newline.
§Examples
use devela::linux_get_line;
let mut buf = [0_u8; 32];
let name: &str = linux_get_line::<32>(&mut buf);
§Error handling
If the read fails, it prints an error message and exits with status code 11.