|
/// The default `VersionRange` represents the range that the Zig Standard Library |
|
/// bases its abstractions on. |
|
.linux => .{ |
|
.linux = .{ |
|
.range = .{ |
|
.min = .{ .major = 4, .minor = 19, .patch = 0 }, |
|
.max = .{ .major = 6, .minor = 5, .patch = 7 }, |
|
}, |
|
.glibc = .{ .major = 2, .minor = 28, .patch = 0 }, |
|
}, |
|
}, |
Yet the release notes say Linux 3.16+.
Mainly bringing this up because I came across this code:
|
// NOSYS happens when `statx` is unsupported, which is the case on kernel versions before 4.11 |
|
// Here, we call `fstat` and fill `stx` with the data we need |
|
.NOSYS => { |
|
const st = try posix.fstat(self.handle); |
|
|
|
stx.mode = @as(u16, @intCast(st.mode)); |
|
|
|
// Hacky conversion from timespec to statx_timestamp |
|
stx.atime = std.mem.zeroes(l.statx_timestamp); |
|
stx.atime.tv_sec = st.atim.tv_sec; |
|
stx.atime.tv_nsec = @as(u32, @intCast(st.atim.tv_nsec)); // Guaranteed to succeed (tv_nsec is always below 10^9) |
|
|
|
stx.mtime = std.mem.zeroes(l.statx_timestamp); |
|
stx.mtime.tv_sec = st.mtim.tv_sec; |
|
stx.mtime.tv_nsec = @as(u32, @intCast(st.mtim.tv_nsec)); |
|
|
|
stx.mask = l.STATX_BASIC_STATS | l.STATX_MTIME; |
|
}, |
And:
❯ man statx|grep 'was added'
statx() was added in Linux 4.11; library support was added in glibc 2.28.
zig/lib/std/Target.zig
Lines 369 to 370 in 3e9ab6a
zig/lib/std/Target.zig
Lines 486 to 494 in 3e9ab6a
Yet the release notes say Linux 3.16+.
Mainly bringing this up because I came across this code:
zig/lib/std/fs/File.zig
Lines 1020 to 1037 in 3e9ab6a
And: