diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-03-18 23:31:56 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-03-19 11:45:10 -0700 |
| commit | 6b2899df2ad5ad139ebcadd7e42762b095853be4 (patch) | |
| tree | b102520fb620a75a46388a28e948804ddaa7efdf /src/main.zig | |
| parent | cd62005f19ff966d2c42de4daeb9a1e4b644bf76 (diff) | |
| download | zig-6b2899df2ad5ad139ebcadd7e42762b095853be4.tar.gz zig-6b2899df2ad5ad139ebcadd7e42762b095853be4.zip | |
compiler: fix wrong detection of rlimit
related to #19352
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig index afdfb49c48..4609109d15 100644 --- a/src/main.zig +++ b/src/main.zig @@ -5985,8 +5985,12 @@ fn parseCodeModel(arg: []const u8) std.builtin.CodeModel { /// garbage collector to run concurrently to zig processes, and to allow multiple /// zig processes to run concurrently with each other, without clobbering each other. fn gimmeMoreOfThoseSweetSweetFileDescriptors() void { + const have_rlimit = switch (builtin.os.tag) { + .windows, .wasi => false, + else => true, + }; + if (!have_rlimit) return; const posix = std.posix; - if (!@hasDecl(posix, "rlimit")) return; var lim = posix.getrlimit(.NOFILE) catch return; // Oh well; we tried. if (comptime builtin.target.isDarwin()) { |
