Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Split out the stat struct for gnu/b32/mips #4276

Merged
merged 2 commits into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/mips/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,30 @@ use crate::{off64_t, off_t};
pub type wchar_t = i32;

s! {
pub struct stat {
pub st_dev: c_ulong,

st_pad1: [c_long; 3],
pub 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: c_ulong,
st_pad2: [c_long; 2],
pub st_size: off_t,
st_pad3: c_long,
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_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt_t,
st_pad5: [c_long; 14],
}

pub struct stat64 {
pub st_dev: c_ulong,
st_pad1: [c_long; 3],
Expand Down
76 changes: 29 additions & 47 deletions src/unix/linux_like/linux/gnu/b32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,55 +40,37 @@ cfg_if! {
}
}

s! {
pub struct stat {
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
pub st_dev: crate::dev_t,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
pub st_dev: c_ulong,

#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
__pad1: c_short,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
st_pad1: [c_long; 3],
pub 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,
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
pub st_rdev: crate::dev_t,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
pub st_rdev: c_ulong,
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
__pad2: c_short,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
st_pad2: [c_long; 2],
pub st_size: off_t,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
st_pad3: c_long,
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
pub st_blksize: crate::blksize_t,
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
pub st_blocks: crate::blkcnt_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,
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
__unused4: c_long,
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
__unused5: c_long,
#[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_if! {
if #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] {
s! {
pub struct stat {
pub st_dev: crate::dev_t,

__pad1: c_short,
pub 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_short,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt_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,
__unused4: c_long,
__unused5: c_long,
}
}
}
}

s! {
pub struct statvfs {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
Expand Down
Loading