Skip to content

Commit ba38ebc

Browse files
committed
Add ioctl FS_IOC_{G,S}ETVERSION and FS_IOC_{G,S}ETFLAGS
1 parent e401a59 commit ba38ebc

File tree

7 files changed

+357
-68
lines changed

7 files changed

+357
-68
lines changed

libc-test/semver/android.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,46 @@ FIONCLEX
610610
FIONREAD
611611
FLUSHO
612612
FOPEN_MAX
613+
FS_IOC_GETFLAGS
614+
FS_IOC_SETFLAGS
615+
FS_IOC_GETVERSION
616+
FS_IOC_SETVERSION
617+
FS_IOC32_GETFLAGS
618+
FS_IOC32_SETFLAGS
619+
FS_IOC32_GETVERSION
620+
FS_IOC32_SETVERSION
621+
FS_SECRM_FL
622+
FS_UNRM_FL
623+
FS_COMPR_FL
624+
FS_SYNC_FL
625+
FS_IMMUTABLE_FL
626+
FS_APPEND_FL
627+
FS_NODUMP_FL
628+
FS_NOATIME_FL
629+
FS_DIRTY_FL
630+
FS_COMPRBLK_FL
631+
FS_NOCOMP_FL
632+
FS_ENCRYPT_FL
633+
FS_BTREE_FL
634+
FS_INDEX_FL
635+
FS_IMAGIC_FL
636+
FS_JOURNAL_DATA_FL
637+
FS_NOTAIL_FL
638+
FS_DIRSYNC_FL
639+
FS_TOPDIR_FL
640+
FS_HUGE_FILE_FL
641+
FS_EXTENT_FL
642+
FS_VERITY_FL
643+
FS_EA_INODE_FL
644+
FS_EOFBLOCKS_FL
645+
FS_NOCOW_FL
646+
FS_DAX_FL
647+
FS_INLINE_DATA_FL
648+
FS_PROJINHERIT_FL
649+
FS_CASEFOLD_FL
650+
FS_RESERVED_FL
651+
FS_FL_USER_VISIBLE
652+
FS_FL_USER_MODIFIABLE
613653
FUTEX_CLOCK_REALTIME
614654
FUTEX_CMD_MASK
615655
FUTEX_CMP_REQUEUE

libc-test/semver/linux.txt

Lines changed: 40 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,46 @@ FIONCLEX
724724
FIONREAD
725725
FLUSHO
726726
FOPEN_MAX
727+
FS_IOC_GETFLAGS
728+
FS_IOC_SETFLAGS
729+
FS_IOC_GETVERSION
730+
FS_IOC_SETVERSION
731+
FS_IOC32_GETFLAGS
732+
FS_IOC32_SETFLAGS
733+
FS_IOC32_GETVERSION
734+
FS_IOC32_SETVERSION
735+
FS_SECRM_FL
736+
FS_UNRM_FL
737+
FS_COMPR_FL
738+
FS_SYNC_FL
739+
FS_IMMUTABLE_FL
740+
FS_APPEND_FL
741+
FS_NODUMP_FL
742+
FS_NOATIME_FL
743+
FS_DIRTY_FL
744+
FS_COMPRBLK_FL
745+
FS_NOCOMP_FL
746+
FS_ENCRYPT_FL
747+
FS_BTREE_FL
748+
FS_INDEX_FL
749+
FS_IMAGIC_FL
750+
FS_JOURNAL_DATA_FL
751+
FS_NOTAIL_FL
752+
FS_DIRSYNC_FL
753+
FS_TOPDIR_FL
754+
FS_HUGE_FILE_FL
755+
FS_EXTENT_FL
756+
FS_VERITY_FL
757+
FS_EA_INODE_FL
758+
FS_EOFBLOCKS_FL
759+
FS_NOCOW_FL
760+
FS_DAX_FL
761+
FS_INLINE_DATA_FL
762+
FS_PROJINHERIT_FL
763+
FS_CASEFOLD_FL
764+
FS_RESERVED_FL
765+
FS_FL_USER_VISIBLE
766+
FS_FL_USER_MODIFIABLE
727767
FUTEX_BITSET_MATCH_ANY
728768
FUTEX_CLOCK_REALTIME
729769
FUTEX_CMD_MASK
@@ -1338,7 +1378,6 @@ MSG_INFO
13381378
MSG_MORE
13391379
MSG_NOERROR
13401380
MSG_NOSIGNAL
1341-
MSG_NOTIFICATION
13421381
MSG_RST
13431382
MSG_STAT
13441383
MSG_SYN
@@ -1815,7 +1854,6 @@ PR_SET_NAME
18151854
PR_SET_NO_NEW_PRIVS
18161855
PR_SET_PDEATHSIG
18171856
PR_SET_PTRACER
1818-
PR_SET_PTRACER_ANY
18191857
PR_SET_SECCOMP
18201858
PR_SET_SECUREBITS
18211859
PR_SET_THP_DISABLE
@@ -2160,70 +2198,6 @@ SCM_J1939_ERRQUEUE
21602198
SCM_J1939_PRIO
21612199
SCM_TIMESTAMP
21622200
SCM_TIMESTAMPING
2163-
SCTP_ABORT
2164-
SCTP_ADDR_OVER
2165-
SCTP_ALL_ASSOC
2166-
SCTP_ASSOCINFO
2167-
SCTP_AUTH_CHUNK
2168-
SCTP_AUTH_ACTIVE_KEY
2169-
SCTP_AUTH_DEACTIVATE_KEY
2170-
SCTP_AUTH_DELETE_KEY
2171-
SCTP_AUTH_KEY
2172-
SCTP_AUTO_ASCONF
2173-
SCTP_AUTOCLOSE
2174-
SCTP_CONTEXT
2175-
SCTP_CURRENT_ASSOC
2176-
SCTP_DELAYED_ACK
2177-
SCTP_DELAYED_ACK_TIME
2178-
SCTP_DELAYED_SACK
2179-
SCTP_DEFAULT_SEND_PARAM
2180-
SCTP_DEFAULT_SNDINFO
2181-
SCTP_ENABLE_CHANGE_ASSOC_REQ
2182-
SCTP_ENABLE_RESET_ASSOC_REQ
2183-
SCTP_ENABLE_RESET_STREAM_REQ
2184-
SCTP_ENABLE_STRRESET_MASK
2185-
SCTP_EOF
2186-
SCTP_EVENTS
2187-
SCTP_FRAGMENT_INTERLEAVE
2188-
SCTP_FUTURE_ASSOC
2189-
SCTP_GET_ASSOC_ID_LIST
2190-
SCTP_GET_ASSOC_NUMBER
2191-
SCTP_GET_PEER_ADDR_INFO
2192-
SCTP_HMAC_IDENT
2193-
SCTP_I_WANT_MAPPED_V4_ADDR
2194-
SCTP_INIT
2195-
SCTP_INITMSG
2196-
SCTP_LOCAL_AUTH_CHUNKS
2197-
SCTP_MAX_BURST
2198-
SCTP_MAXSEG
2199-
SCTP_NODELAY
2200-
SCTP_NOTIFICATION
2201-
SCTP_NXTINFO
2202-
SCTP_PARTIAL_DELIVERY_POINT
2203-
SCTP_PEER_ADDR_PARAMS
2204-
SCTP_PEER_ADDR_THLDS
2205-
SCTP_PEER_ADDR_THLDS_V2
2206-
SCTP_PEER_AUTH_CHUNKS
2207-
SCTP_PR_SCTP_ALL
2208-
SCTP_PR_SCTP_NONE
2209-
SCTP_PR_SCTP_MASK
2210-
SCTP_PR_SCTP_MAX
2211-
SCTP_PR_SCTP_PRIO
2212-
SCTP_PR_SCTP_RTX
2213-
SCTP_PR_SCTP_TTL
2214-
SCTP_PRIMARY_ADDR
2215-
SCTP_RECVNXTINFO
2216-
SCTP_RECVRCVINFO
2217-
SCTP_REUSE_PORT
2218-
SCTP_RTOINFO
2219-
SCTP_SACK_IMMEDIATELY
2220-
SCTP_SENDALL
2221-
SCTP_SET_PEER_PRIMARY_ADDR
2222-
SCTP_SNDRCV
2223-
SCTP_STATUS
2224-
SCTP_STREAM_RESET_INCOMING
2225-
SCTP_STREAM_RESET_OUTGOING
2226-
SCTP_UNORDERED
22272201
SECCOMP_FILTER_FLAG_LOG
22282202
SECCOMP_FILTER_FLAG_SPEC_ALLOW
22292203
SECCOMP_FILTER_FLAG_TSYNC
@@ -3312,7 +3286,6 @@ sched_rr_get_interval
33123286
sched_setaffinity
33133287
sched_setparam
33143288
sched_setscheduler
3315-
sctp_assoc_t
33163289
seccomp_data
33173290
seed48
33183291
seekdir
@@ -3383,7 +3356,6 @@ statfs64
33833356
statvfs64
33843357
strcasecmp
33853358
strcasestr
3386-
strchrnul
33873359
strncasecmp
33883360
strndup
33893361
strsignal

src/unix/linux_like/android/mod.rs

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,6 +1750,67 @@ pub const BLKIOOPT: ::c_int = 0x1279;
17501750
pub const BLKSSZGET: ::c_int = 0x1268;
17511751
pub const BLKPBSZGET: ::c_int = 0x127B;
17521752

1753+
cfg_if! {
1754+
// Those type are constructed using the _IOC macro
1755+
// DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
1756+
// where D stands for direction (either None (00), Read (01) or Write (11))
1757+
// where S stands for size (int, long, struct...)
1758+
// where T stands for type ('f','v','X'...)
1759+
// where N stands for NR (NumbeR)
1760+
if #[cfg(target_arch = "x86")] {
1761+
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80046601;
1762+
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40046602;
1763+
pub const FS_IOC_GETVERSION: ::Ioctl = 0x80047601;
1764+
pub const FS_IOC_SETVERSION: ::Ioctl = 0x40047602;
1765+
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x80046601;
1766+
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x40046602;
1767+
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x80047601;
1768+
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x40047602;
1769+
} else if #[cfg(any(target_arch = "x86_64", target_arch = "riscv64", target_arch = "aarch64"))] {
1770+
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80086601;
1771+
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40086602;
1772+
pub const FS_IOC_GETVERSION: ::Ioctl = 0x80087601;
1773+
pub const FS_IOC_SETVERSION: ::Ioctl = 0x40087602;
1774+
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x80046601;
1775+
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x40046602;
1776+
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x80047601;
1777+
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x40047602;
1778+
}
1779+
}
1780+
1781+
pub const FS_SECRM_FL: ::c_int = 0x00000001;
1782+
pub const FS_UNRM_FL: ::c_int = 0x00000002;
1783+
pub const FS_COMPR_FL: ::c_int = 0x00000004;
1784+
pub const FS_SYNC_FL: ::c_int = 0x00000008;
1785+
pub const FS_IMMUTABLE_FL: ::c_int = 0x00000010;
1786+
pub const FS_APPEND_FL: ::c_int = 0x00000020;
1787+
pub const FS_NODUMP_FL: ::c_int = 0x00000040;
1788+
pub const FS_NOATIME_FL: ::c_int = 0x00000080;
1789+
pub const FS_DIRTY_FL: ::c_int = 0x00000100;
1790+
pub const FS_COMPRBLK_FL: ::c_int = 0x00000200;
1791+
pub const FS_NOCOMP_FL: ::c_int = 0x00000400;
1792+
pub const FS_ENCRYPT_FL: ::c_int = 0x00000800;
1793+
pub const FS_BTREE_FL: ::c_int = 0x00001000;
1794+
pub const FS_INDEX_FL: ::c_int = 0x00001000;
1795+
pub const FS_IMAGIC_FL: ::c_int = 0x00002000;
1796+
pub const FS_JOURNAL_DATA_FL: ::c_int = 0x00004000;
1797+
pub const FS_NOTAIL_FL: ::c_int = 0x00008000;
1798+
pub const FS_DIRSYNC_FL: ::c_int = 0x00010000;
1799+
pub const FS_TOPDIR_FL: ::c_int = 0x00020000;
1800+
pub const FS_HUGE_FILE_FL: ::c_int = 0x00040000;
1801+
pub const FS_EXTENT_FL: ::c_int = 0x00080000;
1802+
pub const FS_VERITY_FL: ::c_int = 0x00100000;
1803+
pub const FS_EA_INODE_FL: ::c_int = 0x00200000;
1804+
pub const FS_EOFBLOCKS_FL: ::c_int = 0x00400000;
1805+
pub const FS_NOCOW_FL: ::c_int = 0x00800000;
1806+
pub const FS_DAX_FL: ::c_int = 0x02000000;
1807+
pub const FS_INLINE_DATA_FL: ::c_int = 0x10000000;
1808+
pub const FS_PROJINHERIT_FL: ::c_int = 0x20000000;
1809+
pub const FS_CASEFOLD_FL: ::c_int = 0x40000000;
1810+
pub const FS_RESERVED_FL: ::c_int = 0x80000000;
1811+
pub const FS_FL_USER_VISIBLE: ::c_int = 0x0003DFFF;
1812+
pub const FS_FL_USER_MODIFIABLE: ::c_int = 0x000380FF;
1813+
17531814
pub const EAI_AGAIN: ::c_int = 2;
17541815
pub const EAI_BADFLAGS: ::c_int = 3;
17551816
pub const EAI_FAIL: ::c_int = 4;

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

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,67 @@ pub const BLKIOOPT: ::Ioctl = 0x1279;
204204
pub const BLKSSZGET: ::Ioctl = 0x1268;
205205
pub const BLKPBSZGET: ::Ioctl = 0x127B;
206206

207+
cfg_if! {
208+
// Those type are constructed using the _IOC macro
209+
// DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
210+
// where D stands for direction (either None (00), Read (01) or Write (11))
211+
// where S stands for size (int, long, struct...)
212+
// where T stands for type ('f','v','X'...)
213+
// where N stands for NR (NumbeR)
214+
if #[cfg(target_arch = "x86")] {
215+
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80046601;
216+
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40046602;
217+
pub const FS_IOC_GETVERSION: ::Ioctl = 0x80047601;
218+
pub const FS_IOC_SETVERSION: ::Ioctl = 0x40047602;
219+
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x80046601;
220+
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x40046602;
221+
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x80047601;
222+
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x40047602;
223+
} else if #[cfg(target_arch = "x86_64")] {
224+
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80086601;
225+
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40086602;
226+
pub const FS_IOC_GETVERSION: ::Ioctl = 0x80087601;
227+
pub const FS_IOC_SETVERSION: ::Ioctl = 0x40087602;
228+
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x80046601;
229+
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x40046602;
230+
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x80047601;
231+
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x40047602;
232+
}
233+
}
234+
235+
pub const FS_SECRM_FL: ::c_int = 0x00000001;
236+
pub const FS_UNRM_FL: ::c_int = 0x00000002;
237+
pub const FS_COMPR_FL: ::c_int = 0x00000004;
238+
pub const FS_SYNC_FL: ::c_int = 0x00000008;
239+
pub const FS_IMMUTABLE_FL: ::c_int = 0x00000010;
240+
pub const FS_APPEND_FL: ::c_int = 0x00000020;
241+
pub const FS_NODUMP_FL: ::c_int = 0x00000040;
242+
pub const FS_NOATIME_FL: ::c_int = 0x00000080;
243+
pub const FS_DIRTY_FL: ::c_int = 0x00000100;
244+
pub const FS_COMPRBLK_FL: ::c_int = 0x00000200;
245+
pub const FS_NOCOMP_FL: ::c_int = 0x00000400;
246+
pub const FS_ENCRYPT_FL: ::c_int = 0x00000800;
247+
pub const FS_BTREE_FL: ::c_int = 0x00001000;
248+
pub const FS_INDEX_FL: ::c_int = 0x00001000;
249+
pub const FS_IMAGIC_FL: ::c_int = 0x00002000;
250+
pub const FS_JOURNAL_DATA_FL: ::c_int = 0x00004000;
251+
pub const FS_NOTAIL_FL: ::c_int = 0x00008000;
252+
pub const FS_DIRSYNC_FL: ::c_int = 0x00010000;
253+
pub const FS_TOPDIR_FL: ::c_int = 0x00020000;
254+
pub const FS_HUGE_FILE_FL: ::c_int = 0x00040000;
255+
pub const FS_EXTENT_FL: ::c_int = 0x00080000;
256+
pub const FS_VERITY_FL: ::c_int = 0x00100000;
257+
pub const FS_EA_INODE_FL: ::c_int = 0x00200000;
258+
pub const FS_EOFBLOCKS_FL: ::c_int = 0x00400000;
259+
pub const FS_NOCOW_FL: ::c_int = 0x00800000;
260+
pub const FS_DAX_FL: ::c_int = 0x02000000;
261+
pub const FS_INLINE_DATA_FL: ::c_int = 0x10000000;
262+
pub const FS_PROJINHERIT_FL: ::c_int = 0x20000000;
263+
pub const FS_CASEFOLD_FL: ::c_int = 0x40000000;
264+
pub const FS_RESERVED_FL: ::c_int = 0x80000000;
265+
pub const FS_FL_USER_VISIBLE: ::c_int = 0x0003DFFF;
266+
pub const FS_FL_USER_MODIFIABLE: ::c_int = 0x000380FF;
267+
207268
cfg_if! {
208269
if #[cfg(any(target_arch = "arm",
209270
target_arch = "s390x"))] {

0 commit comments

Comments
 (0)