Skip to content

Commit

Permalink
__errno_location should call __errno on android
Browse files Browse the repository at this point in the history
  • Loading branch information
roblabla committed Jul 3, 2017
1 parent 5c90e3c commit b63494d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/errno.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,18 @@ unsafe fn errno_location() -> *mut c_int {
__errno()
}

#[cfg(any(target_os = "linux", target_os = "android"))]
#[cfg(target_os = "linux")]
unsafe fn errno_location() -> *mut c_int {
extern { fn __errno_location() -> *mut c_int; }
__errno_location()
}

#[cfg(target_os = "android")]
unsafe fn errno_location() -> *mut c_int {
extern { fn __errno() -> *mut c_int; }
__errno()
}

/// Sets the platform-specific errno to no-error
unsafe fn clear() -> () {
*errno_location() = 0;
Expand Down

0 comments on commit b63494d

Please sign in to comment.