summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg V <greg@unrelenting.technology>2019-12-29 23:07:05 +0000
committerGreg V <greg@unrelenting.technology>2020-07-06 15:31:37 +0300
commite9a75ddd76522bf7e56f282bf64976e0c9e8eb10 (patch)
tree87994ff403a0219f541f6549d18a4ce24993734e
parent8c23f77704d4749f5f137c92a048e22fea9d385e (diff)
downloadrust-libc-e9a75ddd76522bf7e56f282bf64976e0c9e8eb10.tar.gz
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.
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/aarch64.rs26
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs (renamed from src/unix/bsd/freebsdlike/freebsd/freebsd11/x86_64.rs)0
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs7
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs (renamed from src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs)0
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs7
5 files changed, 8 insertions, 32 deletions
diff --git a/src/unix/bsd/freebsdlike/freebsd/aarch64.rs b/src/unix/bsd/freebsdlike/freebsd/aarch64.rs
index 22fd2b84f9..2ac6d4fb6d 100644
--- a/src/unix/bsd/freebsdlike/freebsd/aarch64.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/aarch64.rs
@@ -4,32 +4,6 @@ pub type c_ulong = u64;
pub type time_t = i64;
pub type suseconds_t = i64;
-s! {
- pub struct stat {
- pub st_dev: ::dev_t,
- pub st_ino: ::ino_t,
- pub st_mode: ::mode_t,
- pub st_nlink: ::nlink_t,
- pub st_uid: ::uid_t,
- pub st_gid: ::gid_t,
- pub st_rdev: ::dev_t,
- pub st_atime: ::time_t,
- pub st_atime_nsec: ::c_long,
- pub st_mtime: ::time_t,
- pub st_mtime_nsec: ::c_long,
- pub st_ctime: ::time_t,
- pub st_ctime_nsec: ::c_long,
- pub st_size: ::off_t,
- pub st_blocks: ::blkcnt_t,
- pub st_blksize: ::blksize_t,
- pub st_flags: ::fflags_t,
- pub st_gen: u32,
- pub st_lspare: i32,
- pub st_birthtime: ::time_t,
- pub st_birthtime_nsec: ::c_long,
- }
-}
-
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/x86_64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs
index f32128f775..f32128f775 100644
--- a/src/unix/bsd/freebsdlike/freebsd/freebsd11/x86_64.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
index 79a152fc85..b443da3118 100644
--- a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
@@ -217,8 +217,9 @@ extern "C" {
}
cfg_if! {
- if #[cfg(target_arch = "x86_64")] {
- mod x86_64;
- pub use self::x86_64::*;
+ if #[cfg(any(target_arch = "x86_64",
+ target_arch = "aarch64"))] {
+ mod b64;
+ pub use self::b64::*;
}
}
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs
index 80c6fa1684..80c6fa1684 100644
--- a/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
index 6bf7f957e6..e0dd712bbd 100644
--- a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
@@ -217,8 +217,9 @@ extern "C" {
}
cfg_if! {
- if #[cfg(target_arch = "x86_64")] {
- mod x86_64;
- pub use self::x86_64::*;
+ if #[cfg(any(target_arch = "x86_64",
+ target_arch = "aarch64"))] {
+ mod b64;
+ pub use self::b64::*;
}
}