Skip to content

Commit e9a75dd

Browse files
committed
FreeBSD: use stat header in freebsd11/freebsd12 on aarch64
sys/stat.h is a machine-independent header, but it has ifdefs for i386. The version that was called x86_64.rs should be used on powerpc64 too, but I don't have a machine to test that on.
1 parent 8c23f77 commit e9a75dd

File tree

5 files changed

+8
-32
lines changed

5 files changed

+8
-32
lines changed

src/unix/bsd/freebsdlike/freebsd/aarch64.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,6 @@ pub type c_ulong = u64;
44
pub type time_t = i64;
55
pub type suseconds_t = i64;
66

7-
s! {
8-
pub struct stat {
9-
pub st_dev: ::dev_t,
10-
pub st_ino: ::ino_t,
11-
pub st_mode: ::mode_t,
12-
pub st_nlink: ::nlink_t,
13-
pub st_uid: ::uid_t,
14-
pub st_gid: ::gid_t,
15-
pub st_rdev: ::dev_t,
16-
pub st_atime: ::time_t,
17-
pub st_atime_nsec: ::c_long,
18-
pub st_mtime: ::time_t,
19-
pub st_mtime_nsec: ::c_long,
20-
pub st_ctime: ::time_t,
21-
pub st_ctime_nsec: ::c_long,
22-
pub st_size: ::off_t,
23-
pub st_blocks: ::blkcnt_t,
24-
pub st_blksize: ::blksize_t,
25-
pub st_flags: ::fflags_t,
26-
pub st_gen: u32,
27-
pub st_lspare: i32,
28-
pub st_birthtime: ::time_t,
29-
pub st_birthtime_nsec: ::c_long,
30-
}
31-
}
32-
337
// should be pub(crate), but that requires Rust 1.18.0
348
cfg_if! {
359
if #[cfg(libc_const_size_of)] {

src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,9 @@ extern "C" {
217217
}
218218

219219
cfg_if! {
220-
if #[cfg(target_arch = "x86_64")] {
221-
mod x86_64;
222-
pub use self::x86_64::*;
220+
if #[cfg(any(target_arch = "x86_64",
221+
target_arch = "aarch64"))] {
222+
mod b64;
223+
pub use self::b64::*;
223224
}
224225
}

src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,9 @@ extern "C" {
217217
}
218218

219219
cfg_if! {
220-
if #[cfg(target_arch = "x86_64")] {
221-
mod x86_64;
222-
pub use self::x86_64::*;
220+
if #[cfg(any(target_arch = "x86_64",
221+
target_arch = "aarch64"))] {
222+
mod b64;
223+
pub use self::b64::*;
223224
}
224225
}

0 commit comments

Comments
 (0)