mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +00:00
Merge pull request #5462 from kostikbel/main
freebsd: fix the 'df' command
This commit is contained in:
commit
9697f56e94
1 changed files with 8 additions and 2 deletions
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
//! Set of functions to manage file systems
|
//! Set of functions to manage file systems
|
||||||
|
|
||||||
// spell-checker:ignore DATETIME subsecond (arch) bitrig ; (fs) cifs smbfs
|
// spell-checker:ignore DATETIME getmntinfo subsecond (arch) bitrig ; (fs) cifs smbfs
|
||||||
|
|
||||||
use time::macros::format_description;
|
use time::macros::format_description;
|
||||||
use time::UtcOffset;
|
use time::UtcOffset;
|
||||||
|
@ -362,13 +362,19 @@ extern "C" {
|
||||||
fn get_mount_info(mount_buffer_p: *mut *mut StatFs, flags: c_int) -> c_int;
|
fn get_mount_info(mount_buffer_p: *mut *mut StatFs, flags: c_int) -> c_int;
|
||||||
|
|
||||||
#[cfg(any(
|
#[cfg(any(
|
||||||
target_os = "freebsd",
|
|
||||||
target_os = "netbsd",
|
target_os = "netbsd",
|
||||||
target_os = "openbsd",
|
target_os = "openbsd",
|
||||||
all(target_vendor = "apple", target_arch = "aarch64")
|
all(target_vendor = "apple", target_arch = "aarch64")
|
||||||
))]
|
))]
|
||||||
#[link_name = "getmntinfo"] // spell-checker:disable-line
|
#[link_name = "getmntinfo"] // spell-checker:disable-line
|
||||||
fn get_mount_info(mount_buffer_p: *mut *mut StatFs, flags: c_int) -> c_int;
|
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"] // spell-checker:disable-line
|
||||||
|
fn get_mount_info(mount_buffer_p: *mut *mut StatFs, flags: c_int) -> c_int;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue