Use libc errno
This commit is contained in:
parent
a52da95ced
commit
fe791d7886
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user