Skip to content

Commit

Permalink
fix sparc and add s390x
Browse files Browse the repository at this point in the history
  • Loading branch information
fsavy-tehtris committed Oct 31, 2023
1 parent 12b038f commit 78e1238
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/arch/generic/mod.rs
Expand Up @@ -227,7 +227,7 @@ cfg_if! {
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x40046602;
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x80047601;
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x40047602;
} else if #[cfg(any(target_arch = "x86_64", target_arch = "riscv64", target_arch = "aarch64"))] {
} else if #[cfg(any(target_arch = "x86_64", target_arch = "riscv64", target_arch = "aarch64", target_arch = "s390x"))] {
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80086601;
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40086602;
pub const FS_IOC_GETVERSION: ::Ioctl = 0x80087601;
Expand Down
28 changes: 28 additions & 0 deletions src/unix/linux_like/linux/arch/sparc/mod.rs
Expand Up @@ -226,3 +226,31 @@ cfg_if! {
pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
}
}

cfg_if! {
// Those type are constructed using the _IOC macro
// DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
// where D stands for direction (either None (00), Read (01) or Write (11))
// where S stands for size (int, long, struct...)
// where T stands for type ('f','v','X'...)
// where N stands for NR (NumbeR)
if #[cfg(target_arch = "sparc")] {
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40046601;
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80046602;
pub const FS_IOC_GETVERSION: ::Ioctl = 0x40047601;
pub const FS_IOC_SETVERSION: ::Ioctl = 0x80047602;
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
} else if #[cfg(target_arch = "sparc64")] {
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601;
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80086602;
pub const FS_IOC_GETVERSION: ::Ioctl = 0x40087601;
pub const FS_IOC_SETVERSION: ::Ioctl = 0x80087602;
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
}
}

0 comments on commit 78e1238

Please sign in to comment.