authorgravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2024-02-23 12:08:14-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-24 21:31:48-08:00
log63ea3e172e2788856cfb69b2f6085930a1c69d5b
tree5ec44896c4b3a0682dba10534214ba49dea80072
parent119b2030f70de9ed900ce3594201de6f869b71c8

std: re-enable most of setrlimit test on macos

- skip only RLIMIT_STACK test on macos closes #18395

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

lib/std/os/test.zig+7-5
...@@ -773,11 +773,6 @@ test "fsync" {...@@ -773,11 +773,6 @@ test "fsync" {
773}773}
774774
775test "getrlimit and setrlimit" {775test "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);
788783
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=8258014fd1e34e942a549c88c7e022a00445c352792 // See http://git.musl-libc.org/cgit/musl/commit/src/misc/getrlimit.c?id=8258014fd1e34e942a549c88c7e022a00445c352
791 //793 //