Skip to content

Commit e76c2be

Browse files
committed
Add ioctl FS_IOC_{G,S}ETVERSION and FS_IOC_{G,S}ETFLAGS
1 parent 6e02a32 commit e76c2be

File tree

7 files changed

+156
-0
lines changed

7 files changed

+156
-0
lines changed

libc-test/semver/android.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,14 @@ FIONCLEX
612612
FIONREAD
613613
FLUSHO
614614
FOPEN_MAX
615+
FS_IOC_GETFLAGS
616+
FS_IOC_SETFLAGS
617+
FS_IOC_GETVERSION
618+
FS_IOC_SETVERSION
619+
FS_IOC32_GETFLAGS
620+
FS_IOC32_SETFLAGS
621+
FS_IOC32_GETVERSION
622+
FS_IOC32_SETVERSION
615623
FUTEX_CLOCK_REALTIME
616624
FUTEX_CMD_MASK
617625
FUTEX_CMP_REQUEUE

libc-test/semver/linux.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,14 @@ FIONCLEX
755755
FIONREAD
756756
FLUSHO
757757
FOPEN_MAX
758+
FS_IOC_GETFLAGS
759+
FS_IOC_SETFLAGS
760+
FS_IOC_GETVERSION
761+
FS_IOC_SETVERSION
762+
FS_IOC32_GETFLAGS
763+
FS_IOC32_SETFLAGS
764+
FS_IOC32_GETVERSION
765+
FS_IOC32_SETVERSION
758766
FUTEX_BITSET_MATCH_ANY
759767
FUTEX_CLOCK_REALTIME
760768
FUTEX_CMD_MASK

src/unix/linux_like/android/mod.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,6 +1798,34 @@ pub const BLKIOOPT: ::c_int = 0x1279;
17981798
pub const BLKSSZGET: ::c_int = 0x1268;
17991799
pub const BLKPBSZGET: ::c_int = 0x127B;
18001800

1801+
cfg_if! {
1802+
// Those type are constructed using the _IOC macro
1803+
// DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
1804+
// where D stands for direction (either None (00), Read (01) or Write (11))
1805+
// where S stands for size (int, long, struct...)
1806+
// where T stands for type ('f','v','X'...)
1807+
// where N stands for NR (NumbeR)
1808+
if #[cfg(any(target_arch = "x86", target_arch = "arm"))] {
1809+
pub const FS_IOC_GETFLAGS: ::c_int = 0x80046601;
1810+
pub const FS_IOC_SETFLAGS: ::c_int = 0x40046602;
1811+
pub const FS_IOC_GETVERSION: ::c_int = 0x80047601;
1812+
pub const FS_IOC_SETVERSION: ::c_int = 0x40047602;
1813+
pub const FS_IOC32_GETFLAGS: ::c_int = 0x80046601;
1814+
pub const FS_IOC32_SETFLAGS: ::c_int = 0x40046602;
1815+
pub const FS_IOC32_GETVERSION: ::c_int = 0x80047601;
1816+
pub const FS_IOC32_SETVERSION: ::c_int = 0x40047602;
1817+
} else if #[cfg(any(target_arch = "x86_64", target_arch = "riscv64", target_arch = "aarch64"))] {
1818+
pub const FS_IOC_GETFLAGS: ::c_int = 0x80086601;
1819+
pub const FS_IOC_SETFLAGS: ::c_int = 0x40086602;
1820+
pub const FS_IOC_GETVERSION: ::c_int = 0x80087601;
1821+
pub const FS_IOC_SETVERSION: ::c_int = 0x40087602;
1822+
pub const FS_IOC32_GETFLAGS: ::c_int = 0x80046601;
1823+
pub const FS_IOC32_SETFLAGS: ::c_int = 0x40046602;
1824+
pub const FS_IOC32_GETVERSION: ::c_int = 0x80047601;
1825+
pub const FS_IOC32_SETVERSION: ::c_int = 0x40047602;
1826+
}
1827+
}
1828+
18011829
pub const EAI_AGAIN: ::c_int = 2;
18021830
pub const EAI_BADFLAGS: ::c_int = 3;
18031831
pub const EAI_FAIL: ::c_int = 4;

src/unix/linux_like/linux/arch/generic/mod.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,34 @@ pub const BLKIOOPT: ::Ioctl = 0x1279;
211211
pub const BLKSSZGET: ::Ioctl = 0x1268;
212212
pub const BLKPBSZGET: ::Ioctl = 0x127B;
213213

214+
cfg_if! {
215+
// Those type are constructed using the _IOC macro
216+
// DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
217+
// where D stands for direction (either None (00), Read (01) or Write (11))
218+
// where S stands for size (int, long, struct...)
219+
// where T stands for type ('f','v','X'...)
220+
// where N stands for NR (NumbeR)
221+
if #[cfg(any(target_arch = "x86", target_arch = "arm"))] {
222+
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80046601;
223+
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40046602;
224+
pub const FS_IOC_GETVERSION: ::Ioctl = 0x80047601;
225+
pub const FS_IOC_SETVERSION: ::Ioctl = 0x40047602;
226+
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x80046601;
227+
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x40046602;
228+
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x80047601;
229+
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x40047602;
230+
} else if #[cfg(any(target_arch = "x86_64", target_arch = "riscv64", target_arch = "aarch64", target_arch = "s390x"))] {
231+
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80086601;
232+
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40086602;
233+
pub const FS_IOC_GETVERSION: ::Ioctl = 0x80087601;
234+
pub const FS_IOC_SETVERSION: ::Ioctl = 0x40087602;
235+
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x80046601;
236+
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x40046602;
237+
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x80047601;
238+
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x40047602;
239+
}
240+
}
241+
214242
cfg_if! {
215243
if #[cfg(any(target_arch = "arm",
216244
target_arch = "s390x"))] {

src/unix/linux_like/linux/arch/mips/mod.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,34 @@ pub const BLKIOOPT: ::Ioctl = 0x20001279;
193193
pub const BLKSSZGET: ::Ioctl = 0x20001268;
194194
pub const BLKPBSZGET: ::Ioctl = 0x2000127B;
195195

196+
cfg_if! {
197+
// Those type are constructed using the _IOC macro
198+
// DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
199+
// where D stands for direction (either None (00), Read (01) or Write (11))
200+
// where S stands for size (int, long, struct...)
201+
// where T stands for type ('f','v','X'...)
202+
// where N stands for NR (NumbeR)
203+
if #[cfg(target_arch = "mips")] {
204+
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40046601;
205+
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80046602;
206+
pub const FS_IOC_GETVERSION: ::Ioctl = 0x40047601;
207+
pub const FS_IOC_SETVERSION: ::Ioctl = 0x80047602;
208+
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
209+
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
210+
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
211+
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
212+
} else if #[cfg(target_arch = "mips64")] {
213+
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601;
214+
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80086602;
215+
pub const FS_IOC_GETVERSION: ::Ioctl = 0x40087601;
216+
pub const FS_IOC_SETVERSION: ::Ioctl = 0x80087602;
217+
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
218+
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
219+
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
220+
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
221+
}
222+
}
223+
196224
cfg_if! {
197225
if #[cfg(target_env = "musl")] {
198226
pub const TIOCGRS485: ::Ioctl = 0x4020542e;

src/unix/linux_like/linux/arch/powerpc/mod.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,34 @@ pub const BLKSSZGET: ::Ioctl = 0x20001268;
179179
pub const BLKPBSZGET: ::Ioctl = 0x2000127B;
180180
//pub const FIOQSIZE: ::Ioctl = 0x40086680;
181181

182+
cfg_if! {
183+
// Those type are constructed using the _IOC macro
184+
// DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
185+
// where D stands for direction (either None (00), Read (01) or Write (11))
186+
// where S stands for size (int, long, struct...)
187+
// where T stands for type ('f','v','X'...)
188+
// where N stands for NR (NumbeR)
189+
if #[cfg(target_arch = "powerpc")] {
190+
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40046601;
191+
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80046602;
192+
pub const FS_IOC_GETVERSION: ::Ioctl = 0x40047601;
193+
pub const FS_IOC_SETVERSION: ::Ioctl = 0x80047602;
194+
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
195+
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
196+
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
197+
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
198+
} else if #[cfg(target_arch = "powerpc64")] {
199+
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601;
200+
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80086602;
201+
pub const FS_IOC_GETVERSION: ::Ioctl = 0x40087601;
202+
pub const FS_IOC_SETVERSION: ::Ioctl = 0x80087602;
203+
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
204+
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
205+
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
206+
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
207+
}
208+
}
209+
182210
pub const TIOCM_LE: ::c_int = 0x001;
183211
pub const TIOCM_DTR: ::c_int = 0x002;
184212
pub const TIOCM_RTS: ::c_int = 0x004;

src/unix/linux_like/linux/arch/sparc/mod.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,31 @@ cfg_if! {
226226
pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
227227
}
228228
}
229+
230+
cfg_if! {
231+
// Those type are constructed using the _IOC macro
232+
// DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
233+
// where D stands for direction (either None (00), Read (01) or Write (11))
234+
// where S stands for size (int, long, struct...)
235+
// where T stands for type ('f','v','X'...)
236+
// where N stands for NR (NumbeR)
237+
if #[cfg(target_arch = "sparc")] {
238+
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40046601;
239+
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80046602;
240+
pub const FS_IOC_GETVERSION: ::Ioctl = 0x40047601;
241+
pub const FS_IOC_SETVERSION: ::Ioctl = 0x80047602;
242+
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
243+
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
244+
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
245+
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
246+
} else if #[cfg(target_arch = "sparc64")] {
247+
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601;
248+
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80086602;
249+
pub const FS_IOC_GETVERSION: ::Ioctl = 0x40087601;
250+
pub const FS_IOC_SETVERSION: ::Ioctl = 0x80087602;
251+
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
252+
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
253+
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
254+
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
255+
}
256+
}

0 commit comments

Comments
 (0)