authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-10-15 14:43:57-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-10-15 14:43:57-07:00
log0536c25578fa15e2326eb1061f6db61d6ad3cd65
treef8f98b9c91e0e225cd7aaa45db8ee4cff161d9ec
parent0915d24e6b34b67d358c1309e9bc8516416f1008

std.os: another workaround for stage1 `@minimum` behavior

This is a companion commit to 0915d24e6b34b67d358c1309e9bc8516416f1008.

1 files changed, 3 insertions(+), 1 deletions(-)

lib/std/os.zig+3-1
......@@ -5439,7 +5439,9 @@ pub fn sendfile(
54395439 }
54405440
54415441 // Here we match BSD behavior, making a zero count value send as many bytes as possible.
5442 const adjusted_count = if (in_len == 0) max_count else @minimum(in_len, @as(size_t, max_count));
5442 const adjusted_count_tmp = if (in_len == 0) max_count else @minimum(in_len, @as(size_t, max_count));
5443 // TODO we should not need this cast; improve return type of @minimum
5444 const adjusted_count = @intCast(usize, adjusted_count_tmp);
54435445
54445446 const sendfile_sym = if (builtin.link_libc)
54455447 system.sendfile64