Skip to content

Commit

Permalink
Rollup merge of rust-lang#128967 - devnexen:get_path_fbsd_upd, r=joboet
Browse files Browse the repository at this point in the history
std::fs::get_path freebsd update.

what matters is we re doing the right things as doing sizeof, rather than passing KINFO_FILE_SIZE (only defined on intel architectures), the kernel
 making sure it matches the expectation in its side.
  • Loading branch information
GuillaumeGomez committed Aug 12, 2024
2 parents 4009df9 + 68ff453 commit 8bbf05c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/std/src/sys/pal/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,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 @@ -1541,7 +1541,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 8bbf05c

Please sign in to comment.