| ... | ... | @@ -2986,13 +2986,13 @@ fn gimmeMoreOfThoseSweetSweetFileDescriptors() void { |
| 2986 | 2986 | const posix = std.os; |
| 2987 | 2987 | |
| 2988 | 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 | 2990 | // On Darwin, `NOFILE` is bounded by a hardcoded value `OPEN_MAX`. |
| 2991 | 2991 | // According to the man pages for setrlimit(): |
| 2992 | 2992 | // setrlimit() now returns with errno set to EINVAL in places that historically succeeded. |
| 2993 | 2993 | // It no longer accepts "rlim_cur = RLIM_INFINITY" for RLIM_NOFILE. |
| 2994 | 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 | 2997 | if (lim.cur == lim.max) return; |
| 2998 | 2998 | |