Skip to content

Commit 6b2899d

Browse files
committed
compiler: fix wrong detection of rlimit
related to #19352
1 parent cd62005 commit 6b2899d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main.zig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.
59875987
fn 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()) {

0 commit comments

Comments
 (0)