Use libc errno

This commit is contained in:
Jeremy Soller 2017-01-20 18:44:36 -07:00
parent a52da95ced
commit fe791d7886

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.