Skip to content
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
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 4 additions & 10 deletions src/uucore/src/lib/features/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ impl FileInformation {
any(
target_vendor = "apple",
target_os = "android",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
target_os = "illumos",
Expand All @@ -152,6 +151,8 @@ impl FileInformation {
)
))]
return self.0.st_nlink.into();
#[cfg(target_os = "freebsd")]
return self.0.st_nlink;
#[cfg(target_os = "aix")]
return self.0.st_nlink.try_into().unwrap();
#[cfg(windows)]
Expand All @@ -160,16 +161,9 @@ impl FileInformation {

#[cfg(unix)]
pub fn inode(&self) -> u64 {
#[cfg(all(
not(any(target_os = "freebsd", target_os = "netbsd")),
target_pointer_width = "64"
))]
#[cfg(all(not(any(target_os = "netbsd")), target_pointer_width = "64"))]
return self.0.st_ino;
#[cfg(any(
target_os = "freebsd",
target_os = "netbsd",
not(target_pointer_width = "64")
))]
#[cfg(any(target_os = "netbsd", not(target_pointer_width = "64")))]
return self.0.st_ino.into();
}
}
Expand Down
5 changes: 1 addition & 4 deletions src/uucore/src/lib/features/fsext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,8 @@ unsafe extern "C" {
#[link_name = "getmntinfo"]
fn get_mount_info(mount_buffer_p: *mut *mut StatFs, flags: c_int) -> c_int;

// Rust on FreeBSD uses 11.x ABI for filesystem metadata syscalls.
// Call the right version of the symbol for getmntinfo() result to
// match libc StatFS layout.
#[cfg(target_os = "freebsd")]
#[link_name = "getmntinfo@FBSD_1.0"]
#[link_name = "getmntinfo"]
fn get_mount_info(mount_buffer_p: *mut *mut StatFs, flags: c_int) -> c_int;
}

Expand Down
Loading