crates: make assembly helpers no_std
Some checks failed
Rust / Test on aarch64-unknown-linux-gnu (push) Has been cancelled
Rust / Test on riscv64gc-unknown-linux-gnu (push) Has been cancelled
Rust / Test on x86_64-unknown-linux-gnu (push) Has been cancelled

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I1af24924f436b3f552b67f54bad2c02a6a6a6964
This commit is contained in:
raf 2026-03-27 17:23:58 +03:00
commit 1b0e3070bb
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
3 changed files with 32 additions and 29 deletions

View file

@ -30,7 +30,8 @@ pub fn get_os_pretty_name() -> Result<String, io::Error> {
let mut buffer = [0u8; 1024];
// Use fast syscall-based file reading
let bytes_read = read_file_fast("/etc/os-release", &mut buffer)?;
let bytes_read = read_file_fast("/etc/os-release", &mut buffer)
.map_err(|e| io::Error::from_raw_os_error(-e))?;
let content = &buffer[..bytes_read];
let mut offset = 0;

View file

@ -117,7 +117,8 @@ pub fn get_memory_usage() -> Result<String, io::Error> {
let mut buffer = [0u8; 1024];
// Use fast syscall-based file reading
let bytes_read = read_file_fast("/proc/meminfo", &mut buffer)?;
let bytes_read = read_file_fast("/proc/meminfo", &mut buffer)
.map_err(|e| io::Error::from_raw_os_error(-e))?;
let meminfo = &buffer[..bytes_read];
// Fast scanning for MemTotal and MemAvailable