Skip to content

Commit 5b109dd

Browse files
committed
Add mount ID to statx
This corresponds to the Linux commit fa2fcf4f1df1559a0a4ee0f46915b496cc2ebf60 ("statx: add mount ID"). Note that STATX_ALL is not modified to include this field, because it has actually been deprecated in Linux and is now effectively defined as equal to STATX_BASIC_STATS | STATX_BTIME (see Linux commit 581701b7efd60ba13d8a7eed60cbdd7fefaf6696, "uapi: deprecate STATX_ALL"). Because said commit fa2fcf4f1d is less than a year old, skip testing the STATX_MNT_ID constant. Signed-off-by: Max Reitz <[email protected]>
1 parent d6fbe9b commit 5b109dd

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

libc-test/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2656,6 +2656,9 @@ fn test_linux(target: &str) {
26562656
| "CAN_RAW_FILTER_MAX"
26572657
| "CAN_NPROTO" => true,
26582658

2659+
// FIXME: Requires recent kernel headers (5.8):
2660+
"STATX_MNT_ID" => true,
2661+
26592662
_ => false,
26602663
}
26612664
});

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ s! {
2626
pub stx_rdev_minor: u32,
2727
pub stx_dev_major: u32,
2828
pub stx_dev_minor: u32,
29-
__statx_pad2: [u64; 14],
29+
pub stx_mnt_id: u64,
30+
__statx_pad2: u64,
31+
__statx_pad3: [u64; 12],
3032
}
3133

3234
pub struct statx_timestamp {
@@ -1171,6 +1173,7 @@ pub const STATX_SIZE: ::c_uint = 0x0200;
11711173
pub const STATX_BLOCKS: ::c_uint = 0x0400;
11721174
pub const STATX_BASIC_STATS: ::c_uint = 0x07ff;
11731175
pub const STATX_BTIME: ::c_uint = 0x0800;
1176+
pub const STATX_MNT_ID: ::c_uint = 0x1000;
11741177
pub const STATX_ALL: ::c_uint = 0x0fff;
11751178
pub const STATX__RESERVED: ::c_int = 0x80000000;
11761179
pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004;

0 commit comments

Comments
 (0)