Skip to content

Commit 2e26fbd

Browse files
Linux: Update Statx structure
Also removes the blank lines between members, and a comptime sizeOf check.
1 parent dbf9c7b commit 2e26fbd

File tree

1 file changed

+43
-36
lines changed

1 file changed

+43
-36
lines changed

lib/std/os/linux.zig

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7007,73 +7007,80 @@ pub const STATX_ATTR_ENCRYPTED = 0x0800;
70077007
pub const STATX_ATTR_AUTOMOUNT = 0x1000;
70087008

70097009
pub const statx_timestamp = extern struct {
7010+
/// Number of seconds before or after `1970-01-01T00:00:00Z`.
70107011
sec: i64,
7012+
/// Number of nanoseconds (0..999,999,999) after `sec`.
70117013
nsec: u32,
7014+
// Reserved for future increases in resolution.
70127015
__pad1: u32,
70137016
};
70147017

70157018
/// Renamed to `Statx` to not conflict with the `statx` function.
70167019
pub const Statx = extern struct {
7017-
/// Mask of bits indicating filled fields
7020+
/// Mask of bits indicating filled fields.
70187021
mask: u32,
7019-
7020-
/// Block size for filesystem I/O
7022+
/// Block size for filesystem I/O.
70217023
blksize: u32,
7022-
7023-
/// Extra file attribute indicators
7024+
/// Extra file attribute indicators.
70247025
attributes: u64,
7025-
7026-
/// Number of hard links
7026+
/// Number of hard links.
70277027
nlink: u32,
7028-
7029-
/// User ID of owner
7028+
/// User ID of owner.
70307029
uid: uid_t,
7031-
7032-
/// Group ID of owner
7030+
/// Group ID of owner.
70337031
gid: gid_t,
7034-
7035-
/// File type and mode
7032+
/// File type and mode.
70367033
mode: u16,
7037-
__pad1: u16,
7038-
7039-
/// Inode number
7034+
__spare0: u16,
7035+
/// Inode number.
70407036
ino: u64,
7041-
7042-
/// Total size in bytes
7037+
/// Total size in bytes.
70437038
size: u64,
7044-
7045-
/// Number of 512B blocks allocated
7039+
/// Number of 512B blocks allocated.
70467040
blocks: u64,
7047-
70487041
/// Mask to show what's supported in `attributes`.
70497042
attributes_mask: u64,
7050-
7051-
/// Last access file timestamp
7043+
/// Last access file timestamp.
70527044
atime: statx_timestamp,
7053-
7054-
/// Creation file timestamp
7045+
/// Creation file timestamp.
70557046
btime: statx_timestamp,
7056-
7057-
/// Last status change file timestamp
7047+
/// Last status change file timestamp.
70587048
ctime: statx_timestamp,
7059-
7060-
/// Last modification file timestamp
7049+
/// Last modification file timestamp.
70617050
mtime: statx_timestamp,
7062-
70637051
/// Major ID, if this file represents a device.
70647052
rdev_major: u32,
7065-
70667053
/// Minor ID, if this file represents a device.
70677054
rdev_minor: u32,
7068-
70697055
/// Major ID of the device containing the filesystem where this file resides.
70707056
dev_major: u32,
7071-
70727057
/// Minor ID of the device containing the filesystem where this file resides.
70737058
dev_minor: u32,
7074-
7075-
__pad2: [14]u64,
7076-
};
7059+
/// Mount ID
7060+
mnt_id: u64,
7061+
/// Memory buffer alignment for direct I/O.
7062+
dio_mem_align: u32,
7063+
/// File offset alignment for direct I/O.
7064+
dio_offset_align: u32,
7065+
/// Subvolume identifier.
7066+
subvol: u64,
7067+
/// Min atomic write unit in bytes.
7068+
atomic_write_unit_min: u32,
7069+
/// Max atomic write unit in bytes.
7070+
atomic_write_unit_max: u32,
7071+
/// Max atomic write segment count.
7072+
atomic_write_segments_max: u32,
7073+
/// File offset alignment for direct I/O reads.
7074+
dio_read_offset_align: u32,
7075+
/// Optimised max atomic write unit in bytes.
7076+
atomic_write_unit_max_opt: u32,
7077+
__spare2: [1]u32,
7078+
__spare3: [8]u64,
7079+
};
7080+
7081+
comptime {
7082+
assert(@sizeOf(Statx) == 0x100);
7083+
}
70777084

70787085
pub const addrinfo = extern struct {
70797086
flags: AI,

0 commit comments

Comments
 (0)