From c6073174ab1311fec27fb7ba5921c169656b1448 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 4 Jun 2024 23:33:35 +0000 Subject: [PATCH] std::unix::fs::get_mode implementation for illumos/solaris. they both support the F_GETFL fctnl flag/O_ACCMODE mask to get the file descriptor access modes. --- library/std/src/sys/pal/unix/fs.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/std/src/sys/pal/unix/fs.rs b/library/std/src/sys/pal/unix/fs.rs index a79a232e3d5b8..dbaf86d73a617 100644 --- a/library/std/src/sys/pal/unix/fs.rs +++ b/library/std/src/sys/pal/unix/fs.rs @@ -1557,6 +1557,8 @@ impl fmt::Debug for File { target_os = "netbsd", target_os = "openbsd", target_os = "vxworks", + target_os = "solaris", + target_os = "illumos", target_vendor = "apple", ))] fn get_mode(fd: c_int) -> Option<(bool, bool)> { @@ -1579,6 +1581,8 @@ impl fmt::Debug for File { target_os = "netbsd", target_os = "openbsd", target_os = "vxworks", + target_os = "solaris", + target_os = "illumos", target_vendor = "apple", )))] fn get_mode(_fd: c_int) -> Option<(bool, bool)> {