diff --git a/src/errno.rs b/src/errno.rs index a27abaa730..9102d7b17b 100644 --- a/src/errno.rs +++ b/src/errno.rs @@ -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;