From fd2384b7fab14732efde99da8affd830e2334e16 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 1 May 2020 18:46:23 +0200 Subject: Nightly stuff --- safe_libc/src/errno.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'safe_libc/src/errno.rs') 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 { -- cgit v1.2.3