From e3968be331aaf7fa48f2365998ed4d076ddc82c8 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Thu, 10 Nov 2022 10:06:34 +0000 Subject: Add OpenHarmony targets - `aarch64-unknown-linux-ohos` - `armv7-unknown-linux-ohos` --- library/std/Cargo.toml | 2 +- library/std/src/sys/unix/os.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'library/std') diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml index 598a4bf9282..6345db24054 100644 --- a/library/std/Cargo.toml +++ b/library/std/Cargo.toml @@ -15,7 +15,7 @@ cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] } panic_unwind = { path = "../panic_unwind", optional = true } panic_abort = { path = "../panic_abort" } core = { path = "../core" } -libc = { version = "0.2.139", default-features = false, features = ['rustc-dep-of-std'] } +libc = { version = "0.2.140", default-features = false, features = ['rustc-dep-of-std'] } compiler_builtins = { version = "0.1.87" } profiler_builtins = { path = "../profiler_builtins", optional = true } unwind = { path = "../unwind" } diff --git a/library/std/src/sys/unix/os.rs b/library/std/src/sys/unix/os.rs index 21b035fb373..1c44058aff7 100644 --- a/library/std/src/sys/unix/os.rs +++ b/library/std/src/sys/unix/os.rs @@ -115,7 +115,10 @@ pub fn set_errno(e: i32) { /// Gets a detailed string description for the given error number. pub fn error_string(errno: i32) -> String { extern "C" { - #[cfg_attr(any(target_os = "linux", target_env = "newlib"), link_name = "__xpg_strerror_r")] + #[cfg_attr( + all(any(target_os = "linux", target_env = "newlib"), not(target_env = "ohos")), + link_name = "__xpg_strerror_r" + )] fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: libc::size_t) -> c_int; } -- cgit 1.4.1-3-g733a5