Skip to content

Commit fad45e8

Browse files
authored
Merge pull request #10046 from oech3/libc-df-fbsd
Bump libc to 0.2.178 with fix for FreeBSD
2 parents 8cf88cd + bbd5c4e commit fad45e8

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/uucore/src/lib/features/fs.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ impl FileInformation {
138138
any(
139139
target_vendor = "apple",
140140
target_os = "android",
141-
target_os = "freebsd",
142141
target_os = "netbsd",
143142
target_os = "openbsd",
144143
target_os = "illumos",
@@ -152,6 +151,8 @@ impl FileInformation {
152151
)
153152
))]
154153
return self.0.st_nlink.into();
154+
#[cfg(target_os = "freebsd")]
155+
return self.0.st_nlink;
155156
#[cfg(target_os = "aix")]
156157
return self.0.st_nlink.try_into().unwrap();
157158
#[cfg(windows)]
@@ -160,16 +161,9 @@ impl FileInformation {
160161

161162
#[cfg(unix)]
162163
pub fn inode(&self) -> u64 {
163-
#[cfg(all(
164-
not(any(target_os = "freebsd", target_os = "netbsd")),
165-
target_pointer_width = "64"
166-
))]
164+
#[cfg(all(not(any(target_os = "netbsd")), target_pointer_width = "64"))]
167165
return self.0.st_ino;
168-
#[cfg(any(
169-
target_os = "freebsd",
170-
target_os = "netbsd",
171-
not(target_pointer_width = "64")
172-
))]
166+
#[cfg(any(target_os = "netbsd", not(target_pointer_width = "64")))]
173167
return self.0.st_ino.into();
174168
}
175169
}

src/uucore/src/lib/features/fsext.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,8 @@ unsafe extern "C" {
446446
#[link_name = "getmntinfo"]
447447
fn get_mount_info(mount_buffer_p: *mut *mut StatFs, flags: c_int) -> c_int;
448448

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

0 commit comments

Comments
 (0)