diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt index 5153069559f68..35dd4e94a30c3 100644 --- a/libc-test/semver/android.txt +++ b/libc-test/semver/android.txt @@ -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 diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index b4091a707047d..98df0ed599f96 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -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 diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index cdac6c32ee3f4..bd57fefa77ab3 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -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; diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs index 19d5e7b3938c1..babeaa9f5bf4c 100644 --- a/src/unix/linux_like/linux/arch/generic/mod.rs +++ b/src/unix/linux_like/linux/arch/generic/mod.rs @@ -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"))] { diff --git a/src/unix/linux_like/linux/arch/mips/mod.rs b/src/unix/linux_like/linux/arch/mips/mod.rs index 975e334de5ffb..0950249cd63d1 100644 --- a/src/unix/linux_like/linux/arch/mips/mod.rs +++ b/src/unix/linux_like/linux/arch/mips/mod.rs @@ -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; diff --git a/src/unix/linux_like/linux/arch/powerpc/mod.rs b/src/unix/linux_like/linux/arch/powerpc/mod.rs index 64c3eaab543a6..4c0ee72f80883 100644 --- a/src/unix/linux_like/linux/arch/powerpc/mod.rs +++ b/src/unix/linux_like/linux/arch/powerpc/mod.rs @@ -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; diff --git a/src/unix/linux_like/linux/arch/sparc/mod.rs b/src/unix/linux_like/linux/arch/sparc/mod.rs index da3e388e3d286..7f2ebfd0de773 100644 --- a/src/unix/linux_like/linux/arch/sparc/mod.rs +++ b/src/unix/linux_like/linux/arch/sparc/mod.rs @@ -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; + } +}