Skip to content

Commit

Permalink
feat: add sys_errno_location
Browse files Browse the repository at this point in the history
  • Loading branch information
mkroening committed Jan 3, 2025
1 parent 208b228 commit e455183
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/errno.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,18 @@ pub extern "C" fn sys_errno() -> i32 {
}
}

#[cfg(not(feature = "nostd"))]
#[unsafe(no_mangle)]
pub extern "C" fn sys_errno_location() -> *mut i32 {
cfg_if::cfg_if! {
if #[cfg(any(feature = "common-os", target_arch = "riscv64"))] {
unimplemented!("sys_errno_location")
} else {
ERRNO.get()
}
}
}

pub(crate) trait ToErrno {
fn to_errno(&self) -> Option<i32> {
None
Expand Down

0 comments on commit e455183

Please sign in to comment.