about summary refs log tree commit diff
path: root/library/std
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-03-29 07:16:16 +0000
committerbors <bors@rust-lang.org>2023-03-29 07:16:16 +0000
commitf346fb0bc655acf72e71f1f16065c271447bdbd9 (patch)
tree12ee0966b519561621373db1b6d6904e4a41eb90 /library/std
parent40cd0310db7f67867b305c28fb87b5b660e77df1 (diff)
parente3968be331aaf7fa48f2365998ed4d076ddc82c8 (diff)
downloadrust-f346fb0bc655acf72e71f1f16065c271447bdbd9.tar.gz
rust-f346fb0bc655acf72e71f1f16065c271447bdbd9.zip
Auto merge of #108792 - Amanieu:ohos, r=petrochenkov
Add OpenHarmony targets

- `aarch64-unknown-linux-ohos`
- `armv7-unknown-linux-ohos`

Compiler team MCP: https://github.com/rust-lang/compiler-team/issues/568
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;
     }