Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add ioctl FS_IOC_* version and flag constants #3396

Merged
merged 1 commit into from Nov 14, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions libc-test/semver/android.txt
Expand Up @@ -612,6 +612,14 @@ FIONCLEX
FIONREAD
FLUSHO
FOPEN_MAX
FS_IOC_GETFLAGS
FS_IOC_SETFLAGS
FS_IOC_GETVERSION
FS_IOC_SETVERSION
FS_IOC32_GETFLAGS
FS_IOC32_SETFLAGS
FS_IOC32_GETVERSION
FS_IOC32_SETVERSION
FUTEX_CLOCK_REALTIME
FUTEX_CMD_MASK
FUTEX_CMP_REQUEUE
Expand Down
8 changes: 8 additions & 0 deletions libc-test/semver/linux.txt
Expand Up @@ -755,6 +755,14 @@ FIONCLEX
FIONREAD
FLUSHO
FOPEN_MAX
FS_IOC_GETFLAGS
FS_IOC_SETFLAGS
FS_IOC_GETVERSION
FS_IOC_SETVERSION
FS_IOC32_GETFLAGS
FS_IOC32_SETFLAGS
FS_IOC32_GETVERSION
FS_IOC32_SETVERSION
FUTEX_BITSET_MATCH_ANY
FUTEX_CLOCK_REALTIME
FUTEX_CMD_MASK
Expand Down
28 changes: 28 additions & 0 deletions src/unix/linux_like/android/mod.rs
Expand Up @@ -1798,6 +1798,34 @@ pub const BLKIOOPT: ::c_int = 0x1279;
pub const BLKSSZGET: ::c_int = 0x1268;
pub const BLKPBSZGET: ::c_int = 0x127B;

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(any(target_arch = "x86", target_arch = "arm"))] {
pub const FS_IOC_GETFLAGS: ::c_int = 0x80046601;
pub const FS_IOC_SETFLAGS: ::c_int = 0x40046602;
pub const FS_IOC_GETVERSION: ::c_int = 0x80047601;
pub const FS_IOC_SETVERSION: ::c_int = 0x40047602;
pub const FS_IOC32_GETFLAGS: ::c_int = 0x80046601;
pub const FS_IOC32_SETFLAGS: ::c_int = 0x40046602;
pub const FS_IOC32_GETVERSION: ::c_int = 0x80047601;
pub const FS_IOC32_SETVERSION: ::c_int = 0x40047602;
} else if #[cfg(any(target_arch = "x86_64", target_arch = "riscv64", target_arch = "aarch64"))] {
pub const FS_IOC_GETFLAGS: ::c_int = 0x80086601;
pub const FS_IOC_SETFLAGS: ::c_int = 0x40086602;
pub const FS_IOC_GETVERSION: ::c_int = 0x80087601;
pub const FS_IOC_SETVERSION: ::c_int = 0x40087602;
pub const FS_IOC32_GETFLAGS: ::c_int = 0x80046601;
pub const FS_IOC32_SETFLAGS: ::c_int = 0x40046602;
pub const FS_IOC32_GETVERSION: ::c_int = 0x80047601;
pub const FS_IOC32_SETVERSION: ::c_int = 0x40047602;
}
}

pub const EAI_AGAIN: ::c_int = 2;
pub const EAI_BADFLAGS: ::c_int = 3;
pub const EAI_FAIL: ::c_int = 4;
Expand Down
28 changes: 28 additions & 0 deletions src/unix/linux_like/linux/arch/generic/mod.rs
Expand Up @@ -211,6 +211,34 @@ pub const BLKIOOPT: ::Ioctl = 0x1279;
pub const BLKSSZGET: ::Ioctl = 0x1268;
pub const BLKPBSZGET: ::Ioctl = 0x127B;

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(any(target_arch = "x86", target_arch = "arm"))] {
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80046601;
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40046602;
pub const FS_IOC_GETVERSION: ::Ioctl = 0x80047601;
pub const FS_IOC_SETVERSION: ::Ioctl = 0x40047602;
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x80046601;
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", target_arch = "s390x"))] {
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80086601;
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40086602;
pub const FS_IOC_GETVERSION: ::Ioctl = 0x80087601;
pub const FS_IOC_SETVERSION: ::Ioctl = 0x40087602;
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x80046601;
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x40046602;
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x80047601;
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x40047602;
}
}

cfg_if! {
if #[cfg(any(target_arch = "arm",
target_arch = "s390x"))] {
Expand Down
28 changes: 28 additions & 0 deletions src/unix/linux_like/linux/arch/mips/mod.rs
Expand Up @@ -193,6 +193,34 @@ pub const BLKIOOPT: ::Ioctl = 0x20001279;
pub const BLKSSZGET: ::Ioctl = 0x20001268;
pub const BLKPBSZGET: ::Ioctl = 0x2000127B;

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 = "mips")] {
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 = "mips64")] {
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;
}
}

cfg_if! {
if #[cfg(target_env = "musl")] {
pub const TIOCGRS485: ::Ioctl = 0x4020542e;
Expand Down
28 changes: 28 additions & 0 deletions src/unix/linux_like/linux/arch/powerpc/mod.rs
Expand Up @@ -179,6 +179,34 @@ pub const BLKSSZGET: ::Ioctl = 0x20001268;
pub const BLKPBSZGET: ::Ioctl = 0x2000127B;
//pub const FIOQSIZE: ::Ioctl = 0x40086680;

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 = "powerpc")] {
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 = "powerpc64")] {
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;
}
}

pub const TIOCM_LE: ::c_int = 0x001;
pub const TIOCM_DTR: ::c_int = 0x002;
pub const TIOCM_RTS: ::c_int = 0x004;
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;
}
}