Skip to content

Commit 37017c0

Browse files
committed
Auto merge of rust-lang#128962 - devnexen:fs_get_mode_haiku, r=workingjubilee
std::fs: get_mode implementation for all unix
2 parents c5e8189 + 7eb7376 commit 37017c0

File tree

1 file changed

+0
-27
lines changed
  • std/src/sys/pal/unix

1 file changed

+0
-27
lines changed

Diff for: std/src/sys/pal/unix/fs.rs

-27
Original file line numberDiff line numberDiff line change
@@ -1552,17 +1552,6 @@ impl fmt::Debug for File {
15521552
None
15531553
}
15541554

1555-
#[cfg(any(
1556-
target_os = "linux",
1557-
target_os = "freebsd",
1558-
target_os = "hurd",
1559-
target_os = "netbsd",
1560-
target_os = "openbsd",
1561-
target_os = "vxworks",
1562-
target_os = "solaris",
1563-
target_os = "illumos",
1564-
target_vendor = "apple",
1565-
))]
15661555
fn get_mode(fd: c_int) -> Option<(bool, bool)> {
15671556
let mode = unsafe { libc::fcntl(fd, libc::F_GETFL) };
15681557
if mode == -1 {
@@ -1576,22 +1565,6 @@ impl fmt::Debug for File {
15761565
}
15771566
}
15781567

1579-
#[cfg(not(any(
1580-
target_os = "linux",
1581-
target_os = "freebsd",
1582-
target_os = "hurd",
1583-
target_os = "netbsd",
1584-
target_os = "openbsd",
1585-
target_os = "vxworks",
1586-
target_os = "solaris",
1587-
target_os = "illumos",
1588-
target_vendor = "apple",
1589-
)))]
1590-
fn get_mode(_fd: c_int) -> Option<(bool, bool)> {
1591-
// FIXME(#24570): implement this for other Unix platforms
1592-
None
1593-
}
1594-
15951568
let fd = self.as_raw_fd();
15961569
let mut b = f.debug_struct("File");
15971570
b.field("fd", &fd);

0 commit comments

Comments
 (0)