Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::fs: get_mode implementation for all unix #128962

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions library/std/src/sys/pal/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1552,17 +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_vendor = "apple",
))]
fn get_mode(fd: c_int) -> Option<(bool, bool)> {
let mode = unsafe { libc::fcntl(fd, libc::F_GETFL) };
if mode == -1 {
Expand All @@ -1576,22 +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_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);
Expand Down
2 changes: 1 addition & 1 deletion src/llvm-project
Submodule llvm-project updated 169 files
Loading