authorgravatar for dev@sgregoratto.meStephen Gregoratto <dev@sgregoratto.me> 2025-10-17 14:41:54+11:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-12-14 01:41:47+01:00
logff3fd950a74ab8ea8907a62dbf880eae08232417
tree751686a13d8b75a89de6185d2ca4edded6970075
parentc13857e504f5893cabf182dde1e826131f2acf24

Linux: Update `Statx` structure

Also removes the blank lines between members, and a comptime sizeOf check.

1 files changed, 43 insertions(+), 36 deletions(-)

lib/std/os/linux.zig+43-36
......@@ -6963,73 +6963,80 @@ pub const STATX_ATTR_ENCRYPTED = 0x0800;
69636963pub const STATX_ATTR_AUTOMOUNT = 0x1000;
69646964
69656965pub const statx_timestamp = extern struct {
6966 /// Number of seconds before or after `1970-01-01T00:00:00Z`.
69666967 sec: i64,
6968 /// Number of nanoseconds (0..999,999,999) after `sec`.
69676969 nsec: u32,
6970 // Reserved for future increases in resolution.
69686971 __pad1: u32,
69696972};
69706973
69716974/// Renamed to `Statx` to not conflict with the `statx` function.
69726975pub const Statx = extern struct {
6973 /// Mask of bits indicating filled fields
6976 /// Mask of bits indicating filled fields.
69746977 mask: u32,
6975
6976 /// Block size for filesystem I/O
6978 /// Block size for filesystem I/O.
69776979 blksize: u32,
6978
6979 /// Extra file attribute indicators
6980 /// Extra file attribute indicators.
69806981 attributes: u64,
6981
6982 /// Number of hard links
6982 /// Number of hard links.
69836983 nlink: u32,
6984
6985 /// User ID of owner
6984 /// User ID of owner.
69866985 uid: uid_t,
6987
6988 /// Group ID of owner
6986 /// Group ID of owner.
69896987 gid: gid_t,
6990
6991 /// File type and mode
6988 /// File type and mode.
69926989 mode: u16,
6993 __pad1: u16,
6994
6995 /// Inode number
6990 __spare0: u16,
6991 /// Inode number.
69966992 ino: u64,
6997
6998 /// Total size in bytes
6993 /// Total size in bytes.
69996994 size: u64,
7000
7001 /// Number of 512B blocks allocated
6995 /// Number of 512B blocks allocated.
70026996 blocks: u64,
7003
70046997 /// Mask to show what's supported in `attributes`.
70056998 attributes_mask: u64,
7006
7007 /// Last access file timestamp
6999 /// Last access file timestamp.
70087000 atime: statx_timestamp,
7009
7010 /// Creation file timestamp
7001 /// Creation file timestamp.
70117002 btime: statx_timestamp,
7012
7013 /// Last status change file timestamp
7003 /// Last status change file timestamp.
70147004 ctime: statx_timestamp,
7015
7016 /// Last modification file timestamp
7005 /// Last modification file timestamp.
70177006 mtime: statx_timestamp,
7018
70197007 /// Major ID, if this file represents a device.
70207008 rdev_major: u32,
7021
70227009 /// Minor ID, if this file represents a device.
70237010 rdev_minor: u32,
7024
70257011 /// Major ID of the device containing the filesystem where this file resides.
70267012 dev_major: u32,
7027
70287013 /// Minor ID of the device containing the filesystem where this file resides.
70297014 dev_minor: u32,
7030
7031 __pad2: [14]u64,
7032};
7015 /// Mount ID
7016 mnt_id: u64,
7017 /// Memory buffer alignment for direct I/O.
7018 dio_mem_align: u32,
7019 /// File offset alignment for direct I/O.
7020 dio_offset_align: u32,
7021 /// Subvolume identifier.
7022 subvol: u64,
7023 /// Min atomic write unit in bytes.
7024 atomic_write_unit_min: u32,
7025 /// Max atomic write unit in bytes.
7026 atomic_write_unit_max: u32,
7027 /// Max atomic write segment count.
7028 atomic_write_segments_max: u32,
7029 /// File offset alignment for direct I/O reads.
7030 dio_read_offset_align: u32,
7031 /// Optimised max atomic write unit in bytes.
7032 atomic_write_unit_max_opt: u32,
7033 __spare2: [1]u32,
7034 __spare3: [8]u64,
7035};
7036
7037comptime {
7038 assert(@sizeOf(Statx) == 0x100);
7039}
70337040
70347041pub const addrinfo = extern struct {
70357042 flags: AI,