1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
The patch series taken from upstream unconditionally changes the stat definitions
in src/unix/linux_like/linux/gnu/b32/x86/mod.rs, since we don't enable time64
on i386 this causes us problems. This patch puts back the old definitions and
adds conditionals.
@@ -5,6 +5,7 @@ pub type c_char = i8;
pub type wchar_t = i32;
pub type greg_t = i32;
+#[cfg(gnu_time64_abi)]
pub type statfs64 = statfs;
s! {
@@ -134,7 +135,50 @@ s! {
__unused1: c_ulong,
__unused2: c_ulong,
}
+}
+#[cfg(not(gnu_time64_abi))]
+s! {
+ pub struct stat64 {
+ pub st_dev: crate::dev_t,
+ __pad1: c_uint,
+ __st_ino: crate::ino_t,
+ pub st_mode: crate::mode_t,
+ pub st_nlink: crate::nlink_t,
+ pub st_uid: crate::uid_t,
+ pub st_gid: crate::gid_t,
+ pub st_rdev: crate::dev_t,
+ __pad2: c_uint,
+ pub st_size: crate::off64_t,
+ pub st_blksize: crate::blksize_t,
+ pub st_blocks: crate::blkcnt64_t,
+ pub st_atime: crate::time_t,
+ pub st_atime_nsec: c_long,
+ pub st_mtime: crate::time_t,
+ pub st_mtime_nsec: c_long,
+ pub st_ctime: crate::time_t,
+ pub st_ctime_nsec: c_long,
+ pub st_ino: crate::ino64_t,
+ }
+
+ pub struct statfs64 {
+ pub f_type: crate::__fsword_t,
+ pub f_bsize: crate::__fsword_t,
+ pub f_blocks: u64,
+ pub f_bfree: u64,
+ pub f_bavail: u64,
+ pub f_files: u64,
+ pub f_ffree: u64,
+ pub f_fsid: crate::fsid_t,
+ pub f_namelen: crate::__fsword_t,
+ pub f_frsize: crate::__fsword_t,
+ pub f_flags: crate::__fsword_t,
+ pub f_spare: [crate::__fsword_t; 4],
+ }
+}
+
+#[cfg(gnu_time64_abi)]
+s! {
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
@@ -156,7 +200,9 @@ s! {
pub st_ctime_nsec: c_long,
__pad3: i32,
}
+}
+s! {
pub struct statvfs64 {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
@@ -26,5 +26,9 @@ s! {
pub st_ctime_nsec: crate::c_long,
#[cfg(gnu_time64_abi)]
__pad5: i32,
+ #[cfg(not(gnu_time64_abi))]
+ __unused4: crate::c_long,
+ #[cfg(not(gnu_time64_abi))]
+ __unused5: crate::c_long,
}
}
|