Skip to content

Commit

Permalink
fixup! Adapt stat for gnu_time64_abi
Browse files Browse the repository at this point in the history
Should work for x86 now
  • Loading branch information
snogge committed Feb 7, 2025
1 parent c8a69b3 commit c2943b4
Showing 1 changed file with 34 additions and 20 deletions.
54 changes: 34 additions & 20 deletions src/unix/linux_like/linux/gnu/b32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ cfg_if! {
if #[cfg(target_arch = "riscv32")] {
pub type time_t = i64;
pub type suseconds_t = i64;
pub type ino_t = u64;
type __ino_t = c_ulong;
type __ino64_t = u64;
pub type ino_t = __ino64_t;
pub type off_t = i64;
pub type blkcnt_t = i64;
pub type fsblkcnt_t = u64;
Expand All @@ -39,7 +41,9 @@ cfg_if! {
} else if #[cfg(gnu_file_offset_bits64)] {
pub type time_t = i32;
pub type suseconds_t = i32;
pub type ino_t = u64;
type __ino_t = c_ulong;
type __ino64_t = u64;
pub type ino_t = __ino64_t;
pub type off_t = i64;
pub type blkcnt_t = i64;
pub type fsblkcnt_t = u64;
Expand All @@ -49,7 +53,9 @@ cfg_if! {
} else {
pub type time_t = i32;
pub type suseconds_t = i32;
pub type ino_t = u32;
type __ino_t = c_ulong;
type __ino64_t = u64;
pub type ino_t = __ino_t;
pub type off_t = i32;
pub type blkcnt_t = i32;
pub type fsblkcnt_t = c_ulong;
Expand All @@ -67,12 +73,12 @@ s! {
pub st_dev: c_ulong,

#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
__pad1: c_short,
__pad1: c_ushort,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
st_pad1: [c_long; 3],

#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
pub st_ino: crate::ino_t,
__st_ino: __ino_t,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
__st_ino: crate::ino_t,

Expand All @@ -87,7 +93,7 @@ s! {
pub st_rdev: c_ulong,

#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
__pad2: c_short,
__pad2: c_ushort,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
st_pad2: [c_long; 2],

Expand All @@ -108,28 +114,36 @@ s! {
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,

#[cfg(not(all(
gnu_file_offset_bits64,
any(target_arch = "mips", target_arch = "mips32r6")
)))]
__unused4: c_long,
#[cfg(not(all(
gnu_file_offset_bits64,
any(target_arch = "mips", target_arch = "mips32r6")
)))]
__unused5: c_long,
// #[cfg(all(
// #[cfg(not(all(
// gnu_file_offset_bits64,
// not(any(target_arch = "mips", target_arch = "mips32r6"))
// ))]
// pub st_ino: crate::ino64_t,
// any(target_arch = "mips", target_arch = "mips32r6")
// )))]
// __unused4: c_long,
// #[cfg(not(all(
// gnu_file_offset_bits64,
// any(target_arch = "mips", target_arch = "mips32r6")
// )))]
// __unused5: c_long,

#[cfg(all(
gnu_file_offset_bits64,
not(any(target_arch = "mips", target_arch = "mips32r6"))
))]
pub st_ino: crate::ino_t,

#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
pub st_blksize: crate::blksize_t,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
pub st_blocks: crate::blkcnt_t,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
st_pad5: [c_long; 14],

#[cfg(all(not(gnu_file_offset_bits64),
not(any(target_arch = "mips", target_arch = "mips32r6"))))]
__glibc_reserved4: c_ulong,
#[cfg(all(not(gnu_file_offset_bits64),
not(any(target_arch = "mips", target_arch = "mips32r6"))))]
__glibc_reserved5: c_ulong,
}

pub struct statvfs {
Expand Down

0 comments on commit c2943b4

Please sign in to comment.