| ... | @@ -773,11 +773,6 @@ test "fsync" { | ... | @@ -773,11 +773,6 @@ test "fsync" { |
| 773 | } | 773 | } |
| 774 | | 774 | |
| 775 | test "getrlimit and setrlimit" { | 775 | test "getrlimit and setrlimit" { |
| 776 | if (builtin.target.os.tag == .macos) { | | |
| 777 | // https://github.com/ziglang/zig/issues/18395 | | |
| 778 | return error.SkipZigTest; | | |
| 779 | } | | |
| 780 | | | |
| 781 | if (!@hasDecl(os.system, "rlimit")) { | 776 | if (!@hasDecl(os.system, "rlimit")) { |
| 782 | return error.SkipZigTest; | 777 | return error.SkipZigTest; |
| 783 | } | 778 | } |
| ... | @@ -786,6 +781,13 @@ test "getrlimit and setrlimit" { | ... | @@ -786,6 +781,13 @@ test "getrlimit and setrlimit" { |
| 786 | const resource = @as(os.rlimit_resource, @enumFromInt(field.value)); | 781 | const resource = @as(os.rlimit_resource, @enumFromInt(field.value)); |
| 787 | const limit = try os.getrlimit(resource); | 782 | const limit = try os.getrlimit(resource); |
| 788 | | 783 | |
| | 784 | // XNU kernel does not support RLIMIT_STACK if a custom stack is active, |
| | 785 | // which looks to always be the case. EINVAL is returned. |
| | 786 | // See https://github.com/apple-oss-distributions/xnu/blob/5e3eaea39dcf651e66cb99ba7d70e32cc4a99587/bsd/kern/kern_resource.c#L1173 |
| | 787 | if (builtin.os.tag.isDarwin() and resource == .STACK) { |
| | 788 | continue; |
| | 789 | } |
| | 790 | |
| 789 | // On 32 bit MIPS musl includes a fix which changes limits greater than -1UL/2 to RLIM_INFINITY. | 791 | // On 32 bit MIPS musl includes a fix which changes limits greater than -1UL/2 to RLIM_INFINITY. |
| 790 | // See http://git.musl-libc.org/cgit/musl/commit/src/misc/getrlimit.c?id=8258014fd1e34e942a549c88c7e022a00445c352 | 792 | // See http://git.musl-libc.org/cgit/musl/commit/src/misc/getrlimit.c?id=8258014fd1e34e942a549c88c7e022a00445c352 |
| 791 | // | 793 | // |