Skip to content

Commit

Permalink
compiler: fix wrong detection of rlimit
Browse files Browse the repository at this point in the history
related to #19352
  • Loading branch information
andrewrk committed Mar 19, 2024
1 parent b5ac75b commit 364530b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 364530b

Please sign in to comment.