Skip to content

Commit

Permalink
Rollup merge of rust-lang#39212 - redox-os:master, r=brson
Browse files Browse the repository at this point in the history
Use libc errno in Redox submodule

This fixes https://github.com/redox-os/redox/issues/830, and is necessary when using libc in Redox
  • Loading branch information
GuillaumeGomez committed Jan 25, 2017
2 parents 6ca35a6 + fe791d7 commit fd8988e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/libstd/sys/redox/os.rs
Expand Up @@ -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.
Expand Down

0 comments on commit fd8988e

Please sign in to comment.