Rollup merge of #128967 - devnexen:get_path_fbsd_upd, r=joboet

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.
This commit is contained in:
Matthias Krüger 2024-10-14 06:04:26 +02:00 committed by GitHub
commit 55f8b9e7d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ miniz_oxide = { version = "0.7.0", optional = true, default-features = false }
addr2line = { version = "0.22.0", optional = true, default-features = false }
[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
libc = { version = "0.2.156", default-features = false, features = [
libc = { version = "0.2.159", default-features = false, features = [
'rustc-dep-of-std',
], public = true }

View File

@ -1538,7 +1538,7 @@ fn get_path(fd: c_int) -> Option<PathBuf> {
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() };
@ -1566,7 +1566,7 @@ fn get_path(fd: c_int) -> Option<PathBuf> {
#[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",