about summary refs log tree commit diff
path: root/library/std
diff options
context:
space:
mode:
authorAmanieu d'Antras <amanieu@gmail.com>2022-11-10 10:06:34 +0000
committerAmanieu d'Antras <amanieu@gmail.com>2023-03-28 16:01:13 +0100
commite3968be331aaf7fa48f2365998ed4d076ddc82c8 (patch)
tree78f50787f6df1fb7dbcf3009a3fdd25f8f49dbc6 /library/std
parentdd19135b044cd21a9c3ae7ae87620bf41a208066 (diff)
downloadrust-e3968be331aaf7fa48f2365998ed4d076ddc82c8.tar.gz
rust-e3968be331aaf7fa48f2365998ed4d076ddc82c8.zip
Add OpenHarmony targets
- `aarch64-unknown-linux-ohos`
- `armv7-unknown-linux-ohos`
Diffstat (limited to 'library/std')
-rw-r--r--library/std/Cargo.toml2
-rw-r--r--library/std/src/sys/unix/os.rs5
2 files changed, 5 insertions, 2 deletions
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;
     }