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:
commit
fd8988eb0b
@ -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…
x
Reference in New Issue
Block a user