summaryrefslogtreecommitdiffstats
path: root/library/std/src/sys/unix/os.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /library/std/src/sys/unix/os.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/std/src/sys/unix/os.rs')
-rw-r--r--library/std/src/sys/unix/os.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/library/std/src/sys/unix/os.rs b/library/std/src/sys/unix/os.rs
index 57e1a36da..01ff375d2 100644
--- a/library/std/src/sys/unix/os.rs
+++ b/library/std/src/sys/unix/os.rs
@@ -46,7 +46,8 @@ extern "C" {
target_os = "linux",
target_os = "emscripten",
target_os = "fuchsia",
- target_os = "l4re"
+ target_os = "l4re",
+ target_os = "hurd",
),
link_name = "__errno_location"
)]
@@ -121,7 +122,10 @@ pub fn set_errno(e: i32) {
pub fn error_string(errno: i32) -> String {
extern "C" {
#[cfg_attr(
- all(any(target_os = "linux", target_env = "newlib"), not(target_env = "ohos")),
+ all(
+ any(target_os = "linux", target_os = "hurd", 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;
@@ -359,7 +363,12 @@ pub fn current_exe() -> io::Result<PathBuf> {
}
}
-#[cfg(any(target_os = "linux", target_os = "android", target_os = "emscripten"))]
+#[cfg(any(
+ target_os = "linux",
+ target_os = "hurd",
+ target_os = "android",
+ target_os = "emscripten"
+))]
pub fn current_exe() -> io::Result<PathBuf> {
match crate::fs::read_link("/proc/self/exe") {
Err(ref e) if e.kind() == io::ErrorKind::NotFound => Err(io::const_io_error!(