summaryrefslogtreecommitdiffstats
path: root/safe_libc/src/errno.rs
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2020-05-01 18:46:23 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2020-05-01 22:16:38 +0200
commitfd2384b7fab14732efde99da8affd830e2334e16 (patch)
treea17111e3363c457ec727b52023212c113d8304f6 /safe_libc/src/errno.rs
parent5b449f4e1e43bc59109da5a37edf5ec911d3df8e (diff)
downloadneco-fd2384b7fab14732efde99da8affd830e2334e16.tar
neco-fd2384b7fab14732efde99da8affd830e2334e16.zip
Nightly stuff
Diffstat (limited to 'safe_libc/src/errno.rs')
-rw-r--r--safe_libc/src/errno.rs7
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 {