| ... | @@ -4123,5 +4123,16 @@ test "openat_direct/close_direct" { | ... | @@ -4123,5 +4123,16 @@ test "openat_direct/close_direct" { |
| 4123 | /// For use in tests. Returns SkipZigTest is kernel version is less than required. | 4123 | /// For use in tests. Returns SkipZigTest is kernel version is less than required. |
| 4124 | fn skipKernelLessThan(required: std.SemanticVersion) !void { | 4124 | fn skipKernelLessThan(required: std.SemanticVersion) !void { |
| 4125 | if (builtin.os.tag != .linux) return error.SkipZigTest; | 4125 | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 4126 | if (required.order(builtin.os.version_range.linux.range.max) == .gt) return error.SkipZigTest; | 4126 | |
| | 4127 | var uts: linux.utsname = undefined; |
| | 4128 | const res = linux.uname(&uts); |
| | 4129 | switch (linux.getErrno(res)) { |
| | 4130 | .SUCCESS => {}, |
| | 4131 | else => |errno| return os.unexpectedErrno(errno), |
| | 4132 | } |
| | 4133 | |
| | 4134 | const release = mem.sliceTo(&uts.release, 0); |
| | 4135 | var current = try std.SemanticVersion.parse(release); |
| | 4136 | current.pre = null; // don't check pre field |
| | 4137 | if (required.order(current) == .gt) return error.SkipZigTest; |
| 4127 | } | 4138 | } |