From cb94f6c2dc23892ff84ffd4b8ba204924c3ccc46 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Wed, 28 Feb 2024 19:55:50 +0100 Subject: [PATCH] add missing function to get the latest error number --- hermit-abi/Cargo.toml | 2 +- hermit-abi/src/lib.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hermit-abi/Cargo.toml b/hermit-abi/Cargo.toml index 3fec2f17d..26f9504ee 100644 --- a/hermit-abi/Cargo.toml +++ b/hermit-abi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hermit-abi" -version = "0.3.8" +version = "0.3.9" authors = ["Stefan Lankes"] license = "MIT OR Apache-2.0" edition = "2021" diff --git a/hermit-abi/src/lib.rs b/hermit-abi/src/lib.rs index 482ab2b3e..321f9e1dd 100644 --- a/hermit-abi/src/lib.rs +++ b/hermit-abi/src/lib.rs @@ -337,6 +337,10 @@ pub const S_IFMT: u32 = 0xF000; // sysmbols, which are part of the library operating system extern "C" { + /// Get the last error number from the thread local storage + #[link_name = "sys_get_errno"] + pub fn get_errno() -> i32; + /// If the value at address matches the expected value, park the current thread until it is either /// woken up with [`futex_wake`] (returns 0) or an optional timeout elapses (returns -ETIMEDOUT). ///