authorgravatar for 14938807+xackus@users.noreply.github.comxackus <14938807+xackus@users.noreply.github.com> 2020-11-03 00:58:35+01:00
committergravatar for 14938807+xackus@users.noreply.github.comxackus <14938807+xackus@users.noreply.github.com> 2020-11-03 00:58:35+01:00
loge023a5fe5d8e0c2849c160ffab993ec1e378681c
tree7c245e3fb0d5ca114f66863f0d6528d7f07b7716
parent8dda64fa3e1d3249baa948dc0558e3f65d71e6df

force comptime on isDarwin


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

src/main.zig+2-2
......@@ -2986,13 +2986,13 @@ fn gimmeMoreOfThoseSweetSweetFileDescriptors() void {
29862986 const posix = std.os;
29872987
29882988 var lim = posix.getrlimit(.NOFILE) catch return; // Oh well; we tried.
2989 if (std.Target.current.isDarwin()) {
2989 if (comptime std.Target.current.isDarwin()) {
29902990 // On Darwin, `NOFILE` is bounded by a hardcoded value `OPEN_MAX`.
29912991 // According to the man pages for setrlimit():
29922992 // setrlimit() now returns with errno set to EINVAL in places that historically succeeded.
29932993 // It no longer accepts "rlim_cur = RLIM_INFINITY" for RLIM_NOFILE.
29942994 // Use "rlim_cur = min(OPEN_MAX, rlim_max)".
2995 lim.max = std.math.min(posix.darwin.OPEN_MAX, lim.max);
2995 lim.max = std.math.min(std.os.darwin.OPEN_MAX, lim.max);
29962996 }
29972997 if (lim.cur == lim.max) return;
29982998