authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-03-18 23:31:56-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-03-19 11:45:10-07:00
log6b2899df2ad5ad139ebcadd7e42762b095853be4
treeb102520fb620a75a46388a28e948804ddaa7efdf
parentcd62005f19ff966d2c42de4daeb9a1e4b644bf76

compiler: fix wrong detection of rlimit

related to #19352

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

src/main.zig+5-1
......@@ -5985,8 +5985,12 @@ fn parseCodeModel(arg: []const u8) std.builtin.CodeModel {
59855985/// garbage collector to run concurrently to zig processes, and to allow multiple
59865986/// zig processes to run concurrently with each other, without clobbering each other.
59875987fn gimmeMoreOfThoseSweetSweetFileDescriptors() void {
5988 const have_rlimit = switch (builtin.os.tag) {
5989 .windows, .wasi => false,
5990 else => true,
5991 };
5992 if (!have_rlimit) return;
59885993 const posix = std.posix;
5989 if (!@hasDecl(posix, "rlimit")) return;
59905994
59915995 var lim = posix.getrlimit(.NOFILE) catch return; // Oh well; we tried.
59925996 if (comptime builtin.target.isDarwin()) {