mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
freebsd: fix the 'df' command
df, and perhaps other commands, get the list of the mounted filesystems with the call to getmntinfo(3). Since Rust still use FreeBSD 11.x ABI for filesystem metadata call, it should use matching versioned symbol for getmntinfo from libc.
This commit is contained in:
parent
6085cf12e3
commit
11f56a79af
1 changed files with 7 additions and 1 deletions
|
@ -362,13 +362,19 @@ extern "C" {
|
|||
fn get_mount_info(mount_buffer_p: *mut *mut StatFs, flags: c_int) -> c_int;
|
||||
|
||||
#[cfg(any(
|
||||
target_os = "freebsd",
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
all(target_vendor = "apple", target_arch = "aarch64")
|
||||
))]
|
||||
#[link_name = "getmntinfo"] // spell-checker:disable-line
|
||||
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"))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue