mirror of
https://github.com/NotAShelf/microfetch.git
synced 2026-04-12 12:57:41 +00:00
crates: make assembly helpers no_std
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I1af24924f436b3f552b67f54bad2c02a6a6a6964
This commit is contained in:
parent
325bc7ab5a
commit
1b0e3070bb
3 changed files with 32 additions and 29 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue