about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/redox/os.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libstd/sys/redox/os.rs b/src/libstd/sys/redox/os.rs
index 135e972bca4..9d459581dd4 100644
--- a/src/libstd/sys/redox/os.rs
+++ b/src/libstd/sys/redox/os.rs
@@ -33,9 +33,16 @@ use vec;
 const TMPBUF_SZ: usize = 128;
 static ENV_LOCK: Mutex = Mutex::new();
 
+extern {
+    #[link_name = "__errno_location"]
+    fn errno_location() -> *mut i32;
+}
+
 /// Returns the platform-specific value of errno
 pub fn errno() -> i32 {
-    0
+    unsafe {
+        (*errno_location())
+    }
 }
 
 /// Gets a detailed string description for the given error number.