Skip to content

Commit

Permalink
std::fs::get_path freebsd update.
Browse files Browse the repository at this point in the history
what matters is we re doing the right things as doing sizeof, rather than
KINFO_FILE_SIZE (only defined on intel architectures), the kernel
 making sure it matches the expectation in its side.
  • Loading branch information
devnexen committed Oct 3, 2024
1 parent 86fa474 commit 26b231b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions std/src/sys/pal/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,7 @@ impl fmt::Debug for File {
Some(PathBuf::from(OsString::from_vec(buf)))
}

#[cfg(all(target_os = "freebsd", target_arch = "x86_64"))]
#[cfg(target_os = "freebsd")]
fn get_path(fd: c_int) -> Option<PathBuf> {
let info = Box::<libc::kinfo_file>::new_zeroed();
let mut info = unsafe { info.assume_init() };
Expand Down Expand Up @@ -1566,7 +1566,7 @@ impl fmt::Debug for File {
#[cfg(not(any(
target_os = "linux",
target_os = "vxworks",
all(target_os = "freebsd", target_arch = "x86_64"),
target_os = "freebsd",
target_os = "netbsd",
target_os = "illumos",
target_os = "solaris",
Expand Down

0 comments on commit 26b231b

Please sign in to comment.