| ... | ... | @@ -483,7 +483,7 @@ pub fn getrandom(buffer: []u8) GetRandomError!void { |
| 483 | 483 | if (builtin.os.tag == .linux or builtin.os.tag == .freebsd) { |
| 484 | 484 | var buf = buffer; |
| 485 | 485 | const use_c = builtin.os.tag != .linux or |
| 486 | | std.c.versionCheck(std.SemanticVersion{ .major = 2, .minor = 25, .patch = 0 }).ok; |
| 486 | std.c.versionCheck(std.SemanticVersion{ .major = 2, .minor = 25, .patch = 0 }); |
| 487 | 487 | |
| 488 | 488 | while (buf.len != 0) { |
| 489 | 489 | const res = if (use_c) blk: { |
| ... | ... | @@ -6210,7 +6210,7 @@ pub fn sendfile( |
| 6210 | 6210 | .linux => sf: { |
| 6211 | 6211 | // sendfile() first appeared in Linux 2.2, glibc 2.1. |
| 6212 | 6212 | const call_sf = comptime if (builtin.link_libc) |
| 6213 | | std.c.versionCheck(.{ .major = 2, .minor = 1, .patch = 0 }).ok |
| 6213 | std.c.versionCheck(.{ .major = 2, .minor = 1, .patch = 0 }) |
| 6214 | 6214 | else |
| 6215 | 6215 | builtin.os.version_range.linux.range.max.order(.{ .major = 2, .minor = 2, .patch = 0 }) != .lt; |
| 6216 | 6216 | if (!call_sf) break :sf; |
| ... | ... | @@ -6510,7 +6510,7 @@ var has_copy_file_range_syscall = std.atomic.Value(bool).init(true); |
| 6510 | 6510 | pub fn copy_file_range(fd_in: fd_t, off_in: u64, fd_out: fd_t, off_out: u64, len: usize, flags: u32) CopyFileRangeError!usize { |
| 6511 | 6511 | if ((comptime builtin.os.isAtLeast(.freebsd, .{ .major = 13, .minor = 0, .patch = 0 }) orelse false) or |
| 6512 | 6512 | ((comptime builtin.os.isAtLeast(.linux, .{ .major = 4, .minor = 5, .patch = 0 }) orelse false and |
| 6513 | | std.c.versionCheck(.{ .major = 2, .minor = 27, .patch = 0 }).ok) and |
| 6513 | std.c.versionCheck(.{ .major = 2, .minor = 27, .patch = 0 })) and |
| 6514 | 6514 | has_copy_file_range_syscall.load(.Monotonic))) |
| 6515 | 6515 | { |
| 6516 | 6516 | var off_in_copy = @as(i64, @bitCast(off_in)); |
| ... | ... | @@ -6829,7 +6829,7 @@ pub fn memfd_createZ(name: [*:0]const u8, flags: u32) MemFdCreateError!fd_t { |
| 6829 | 6829 | switch (builtin.os.tag) { |
| 6830 | 6830 | .linux => { |
| 6831 | 6831 | // memfd_create is available only in glibc versions starting with 2.27. |
| 6832 | | const use_c = std.c.versionCheck(.{ .major = 2, .minor = 27, .patch = 0 }).ok; |
| 6832 | const use_c = std.c.versionCheck(.{ .major = 2, .minor = 27, .patch = 0 }); |
| 6833 | 6833 | const sys = if (use_c) std.c else linux; |
| 6834 | 6834 | const getErrno = if (use_c) std.c.getErrno else linux.getErrno; |
| 6835 | 6835 | const rc = sys.memfd_create(name, flags); |