Skip to content

Commit

Permalink
Auto merge of rust-lang#3076 - ETKNeil:add-statx-dioalign, r=JohnTitor
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
bors committed Feb 20, 2023
2 parents 89fb7bf + 69f06d1 commit 9e63320
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions libc-test/build.rs
Expand Up @@ -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+
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/linux-gnu.txt
Expand Up @@ -435,6 +435,7 @@ STATX_BASIC_STATS
STATX_BLOCKS
STATX_BTIME
STATX_CTIME
STATX_DIOALIGN
STATX_GID
STATX_INO
STATX_MNT_ID
Expand Down
4 changes: 3 additions & 1 deletion src/unix/linux_like/linux/gnu/mod.rs
Expand Up @@ -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],
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9e63320

Please sign in to comment.