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 {...@@ -2986,13 +2986,13 @@ fn gimmeMoreOfThoseSweetSweetFileDescriptors() void {
2986 const posix = std.os;2986 const posix = std.os;
29872987
2988 var lim = posix.getrlimit(.NOFILE) catch return; // Oh well; we tried.2988 var lim = posix.getrlimit(.NOFILE) catch return; // Oh well; we tried.
2989 if (std.Target.current.isDarwin()) {2989 if (comptime std.Target.current.isDarwin()) {
2990 // On Darwin, `NOFILE` is bounded by a hardcoded value `OPEN_MAX`.2990 // On Darwin, `NOFILE` is bounded by a hardcoded value `OPEN_MAX`.
2991 // According to the man pages for setrlimit():2991 // According to the man pages for setrlimit():
2992 // setrlimit() now returns with errno set to EINVAL in places that historically succeeded.2992 // setrlimit() now returns with errno set to EINVAL in places that historically succeeded.
2993 // It no longer accepts "rlim_cur = RLIM_INFINITY" for RLIM_NOFILE.2993 // It no longer accepts "rlim_cur = RLIM_INFINITY" for RLIM_NOFILE.
2994 // Use "rlim_cur = min(OPEN_MAX, rlim_max)".2994 // 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);
2996 }2996 }
2997 if (lim.cur == lim.max) return;2997 if (lim.cur == lim.max) return;
29982998