summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-02-20 13:04:50 +0000
committerbors <bors@rust-lang.org>2023-02-20 13:04:50 +0000
commit9e633205ce8c7ed450da4af68bc57ca98d88de8a (patch)
treedbfd9b71fa3de1af8c4765899a1f7a3e3250d41b
parent89fb7bf0e6f0c3f7ea4ff7fe5a14a3909f9b9298 (diff)
parent69f06d1046afc9dbc7d9de7d50e4a28ec7cabb5b (diff)
downloadrust-libc-9e633205ce8c7ed450da4af68bc57ca98d88de8a.tar.gz
Auto merge of #3076 - ETKNeil:add-statx-dioalign, r=JohnTitor
Add STATX_DIOALIGN (introduced in linux v6.1) The [STATX_DIOALIGN](https://elixir.bootlin.com/linux/v6.1/A/ident/STATX_DIOALIGN) constant was introduced in linux 6.1 The statx structure thus gained [2 more fields](https://elixir.bootlin.com/linux/v6.1/source/include/uapi/linux/stat.h#L127)
-rw-r--r--libc-test/build.rs3
-rw-r--r--libc-test/semver/linux-gnu.txt1
-rw-r--r--src/unix/linux_like/linux/gnu/mod.rs4
3 files changed, 7 insertions, 1 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index d05672a47e..a4058f89d0 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -3596,6 +3596,9 @@ fn test_linux(target: &str) {
// Added in Linux 5.14
"FUTEX_LOCK_PI2" => true,
+ // Added in linux 6.1
+ "STATX_DIOALIGN" => true,
+
// FIXME: Parts of netfilter/nfnetlink*.h require more recent kernel headers:
| "RTNLGRP_MCTP_IFADDR" // linux v5.17+
| "RTNLGRP_TUNNEL" // linux v5.18+
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
index 665b085a7e..aaeb408150 100644
--- a/libc-test/semver/linux-gnu.txt
+++ b/libc-test/semver/linux-gnu.txt
@@ -435,6 +435,7 @@ STATX_BASIC_STATS
STATX_BLOCKS
STATX_BTIME
STATX_CTIME
+STATX_DIOALIGN
STATX_GID
STATX_INO
STATX_MNT_ID
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index b8b6dedeb7..21396751d0 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -37,7 +37,8 @@ s! {
pub stx_dev_major: u32,
pub stx_dev_minor: u32,
pub stx_mnt_id: u64,
- __statx_pad2: u64,
+ pub stx_dio_mem_align: u32,
+ pub stx_dio_offset_align: u32,
__statx_pad3: [u64; 12],
}
@@ -1022,6 +1023,7 @@ pub const STATX_BLOCKS: ::c_uint = 0x0400;
pub const STATX_BASIC_STATS: ::c_uint = 0x07ff;
pub const STATX_BTIME: ::c_uint = 0x0800;
pub const STATX_MNT_ID: ::c_uint = 0x1000;
+pub const STATX_DIOALIGN: ::c_uint = 0x2000;
pub const STATX_ALL: ::c_uint = 0x0fff;
pub const STATX__RESERVED: ::c_int = 0x80000000;
pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004;