about summary refs log tree commit diff
path: root/library/std/src/sys/unix/os.rs
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/src/sys/unix/os.rs
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/src/sys/unix/os.rs')
-rw-r--r--library/std/src/sys/unix/os.rs5
1 files changed, 4 insertions, 1 deletions
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;
     }