Skip to content

Commit 82fecbd

Browse files
rusty-snaketgross35
authored andcommitted
Update statx constants and types (Linux 6.8-6.14)
1 parent ec7da63 commit 82fecbd

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

libc-test/build.rs

+7
Original file line numberDiff line numberDiff line change
@@ -4384,6 +4384,13 @@ fn test_linux(target: &str) {
43844384
| "CANXL_XLF"
43854385
=> true,
43864386

4387+
"STATX_MNT_ID_UNIQUE" // Added in Linux 6.8
4388+
| "STATX_SUBVOL" // Added in Linux 6.10
4389+
| "STATX_WRITE_ATOMIC" // Added in Linux 6.11
4390+
| "STATX_ATTR_WRITE_ATOMIC" // Added in Linux 6.11
4391+
| "STATX_DIO_READ_ALIGN" // Added in Linux 6.14
4392+
=> true,
4393+
43874394
// FIXME(linux): Parts of netfilter/nfnetlink*.h require more recent kernel headers:
43884395
| "RTNLGRP_MCTP_IFADDR" // linux v5.17+
43894396
| "RTNLGRP_TUNNEL" // linux v5.18+

libc-test/semver/linux-gnu.txt

+5
Original file line numberDiff line numberDiff line change
@@ -418,20 +418,25 @@ STATX_ATTR_IMMUTABLE
418418
STATX_ATTR_MOUNT_ROOT
419419
STATX_ATTR_NODUMP
420420
STATX_ATTR_VERITY
421+
STATX_ATTR_WRITE_ATOMIC
421422
STATX_BASIC_STATS
422423
STATX_BLOCKS
423424
STATX_BTIME
424425
STATX_CTIME
425426
STATX_DIOALIGN
427+
STATX_DIO_READ_ALIGN
426428
STATX_GID
427429
STATX_INO
428430
STATX_MNT_ID
431+
STATX_MNT_ID_UNIQUE
429432
STATX_MODE
430433
STATX_MTIME
431434
STATX_NLINK
432435
STATX_SIZE
436+
STATX_SUBVOL
433437
STATX_TYPE
434438
STATX_UID
439+
STATX_WRITE_ATOMIC
435440
STATX__RESERVED
436441
STA_CLK
437442
STA_CLOCKERR

src/unix/linux_like/mod.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,12 @@ cfg_if! {
239239
pub stx_mnt_id: crate::__u64,
240240
pub stx_dio_mem_align: crate::__u32,
241241
pub stx_dio_offset_align: crate::__u32,
242-
__statx_pad3: [crate::__u64; 12],
242+
pub stx_subvol: crate::__u64,
243+
pub stx_atomic_write_unit_min: crate::__u32,
244+
pub stx_atomic_write_unit_max: crate::__u32,
245+
pub stx_atomic_write_segments_max: crate::__u32,
246+
pub stx_dio_read_offset_align: crate::__u32,
247+
__statx_pad3: [crate::__u64; 9],
243248
}
244249

245250
pub struct statx_timestamp {
@@ -1617,6 +1622,10 @@ cfg_if! {
16171622
pub const STATX_ALL: c_uint = 0x0fff;
16181623
pub const STATX_MNT_ID: c_uint = 0x1000;
16191624
pub const STATX_DIOALIGN: c_uint = 0x2000;
1625+
pub const STATX_MNT_ID_UNIQUE: c_uint = 0x4000;
1626+
pub const STATX_SUBVOL: c_uint = 0x_0000_8000;
1627+
pub const STATX_WRITE_ATOMIC: c_uint = 0x_0001_0000;
1628+
pub const STATX_DIO_READ_ALIGN: c_uint = 0x_0002_0000;
16201629
pub const STATX__RESERVED: c_int = 0x80000000;
16211630
pub const STATX_ATTR_COMPRESSED: c_int = 0x0004;
16221631
pub const STATX_ATTR_IMMUTABLE: c_int = 0x0010;
@@ -1627,6 +1636,7 @@ cfg_if! {
16271636
pub const STATX_ATTR_MOUNT_ROOT: c_int = 0x2000;
16281637
pub const STATX_ATTR_VERITY: c_int = 0x100000;
16291638
pub const STATX_ATTR_DAX: c_int = 0x200000;
1639+
pub const STATX_ATTR_WRITE_ATOMIC: c_int = 0x400000;
16301640
}
16311641
}
16321642

0 commit comments

Comments
 (0)