Rollup merge of #39212 - redox-os:master, r=brson

Use libc errno in Redox submodule

This fixes https://github.com/redox-os/redox/issues/830, and is necessary when using libc in Redox
This commit is contained in:
Guillaume Gomez 2017-01-25 17:08:16 +01:00 committed by GitHub
commit fd8988eb0b

View File

@ -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.