diff options
Diffstat (limited to 'safe_libc/src/errno.rs')
-rw-r--r-- | safe_libc/src/errno.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/safe_libc/src/errno.rs b/safe_libc/src/errno.rs index be944d1..2a2220b 100644 --- a/safe_libc/src/errno.rs +++ b/safe_libc/src/errno.rs @@ -6,9 +6,14 @@ use core::fmt; #[repr(transparent)] pub struct Errno(pub libc::c_int); +extern "C" { + //#[ffi_const] + pub fn __errno_location() -> *mut libc::c_int; +} + #[inline] pub fn errno() -> Errno { - unsafe { Errno(*libc::__errno_location()) } + unsafe { Errno(*__errno_location()) } } impl fmt::Display for Errno { |