From a7be5bf683be4b69cc92e42bc2ae695724dc47e0 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 11 Aug 2024 10:14:57 +0000 Subject: [PATCH 1/2] std::fs: get_mode implementation for haiku. --- library/std/src/sys/pal/unix/fs.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/std/src/sys/pal/unix/fs.rs b/library/std/src/sys/pal/unix/fs.rs index bdb83f0785784..ff7ee4fdfa81b 100644 --- a/library/std/src/sys/pal/unix/fs.rs +++ b/library/std/src/sys/pal/unix/fs.rs @@ -1561,6 +1561,7 @@ impl fmt::Debug for File { target_os = "vxworks", target_os = "solaris", target_os = "illumos", + target_os = "haiku", target_vendor = "apple", ))] fn get_mode(fd: c_int) -> Option<(bool, bool)> { @@ -1585,6 +1586,7 @@ impl fmt::Debug for File { target_os = "vxworks", target_os = "solaris", target_os = "illumos", + target_os = "haiku", target_vendor = "apple", )))] fn get_mode(_fd: c_int) -> Option<(bool, bool)> { From 70e0f69632591add54bc1e4d625e7bbb9fa02095 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Mon, 12 Aug 2024 23:44:42 +0100 Subject: [PATCH 2/2] trying common codepath for every unixes --- library/std/src/sys/pal/unix/fs.rs | 29 ----------------------------- src/llvm-project | 2 +- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/library/std/src/sys/pal/unix/fs.rs b/library/std/src/sys/pal/unix/fs.rs index ff7ee4fdfa81b..be13e1ae9b32f 100644 --- a/library/std/src/sys/pal/unix/fs.rs +++ b/library/std/src/sys/pal/unix/fs.rs @@ -1552,18 +1552,6 @@ impl fmt::Debug for File { None } - #[cfg(any( - target_os = "linux", - target_os = "freebsd", - target_os = "hurd", - target_os = "netbsd", - target_os = "openbsd", - target_os = "vxworks", - target_os = "solaris", - target_os = "illumos", - target_os = "haiku", - target_vendor = "apple", - ))] fn get_mode(fd: c_int) -> Option<(bool, bool)> { let mode = unsafe { libc::fcntl(fd, libc::F_GETFL) }; if mode == -1 { @@ -1577,23 +1565,6 @@ impl fmt::Debug for File { } } - #[cfg(not(any( - target_os = "linux", - target_os = "freebsd", - target_os = "hurd", - target_os = "netbsd", - target_os = "openbsd", - target_os = "vxworks", - target_os = "solaris", - target_os = "illumos", - target_os = "haiku", - target_vendor = "apple", - )))] - fn get_mode(_fd: c_int) -> Option<(bool, bool)> { - // FIXME(#24570): implement this for other Unix platforms - None - } - let fd = self.as_raw_fd(); let mut b = f.debug_struct("File"); b.field("fd", &fd); diff --git a/src/llvm-project b/src/llvm-project index ccf4c38bdd73f..57ae1a3474057 160000 --- a/src/llvm-project +++ b/src/llvm-project @@ -1 +1 @@ -Subproject commit ccf4c38bdd73f1a37ec266c73bdaef80e39f8cf6 +Subproject commit 57ae1a3474057fead2c438928ed368b3740bf0ec