From deb46e1dd397672330373c5546e7ef90a4ec3f1f Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 3 Sep 2025 02:23:19 +0100 Subject: [PATCH 1/2] std.posix: Fix getRandomBytesDevURandom() This is not exercised in CI because most platforms have a dedicated implementation in getrandom(). --- lib/std/posix.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/posix.zig b/lib/std/posix.zig index 1bce41c2e99a074cab5b91e04cd7f44db521a228..815d2894e955a172e0a8c9fd0a9eaa90f6b01ba8 100644 --- a/lib/std/posix.zig +++ b/lib/std/posix.zig @@ -672,7 +672,7 @@ fn getRandomBytesDevURandom(buf: []u8) !void { const file: fs.File = .{ .handle = fd }; var file_reader = file.readerStreaming(&.{}); - file_reader.readSliceAll(buf) catch return error.Unexpected; + file_reader.interface.readSliceAll(buf) catch return error.Unexpected; } /// Causes abnormal process termination. -- 2.54.0 From 79f60302d659c7719f8b9b6b35629d7450459030 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 3 Sep 2025 02:24:47 +0100 Subject: [PATCH 2/2] std.c: Enable arc4random_buf for serenity --- lib/std/c.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/c.zig b/lib/std/c.zig index 7cec1df782aea6ee099cfc52cf30bdab0dde7e18..516185878b62624fb329934a2cbb488f2ca7d98d 100644 --- a/lib/std/c.zig +++ b/lib/std/c.zig @@ -10353,7 +10353,7 @@ pub extern "c" fn setrlimit64(resource: rlimit_resource, rlim: *const rlimit) c_ pub const arc4random_buf = switch (native_os) { .linux => if (builtin.abi.isAndroid()) private.arc4random_buf else {}, - .dragonfly, .netbsd, .freebsd, .solaris, .openbsd, .macos, .ios, .tvos, .watchos, .visionos => private.arc4random_buf, + .dragonfly, .netbsd, .freebsd, .solaris, .openbsd, .serenity, .macos, .ios, .tvos, .watchos, .visionos => private.arc4random_buf, else => {}, }; pub const getentropy = switch (native_os) { -- 2.54.0