authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-09-03 19:55:46+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-09-03 19:55:46+02:00
loga11dfaf61aa83df6c58b647e20c1a03d2e767f7b
treece79687fa3c7560f2d737df9d31644aa7edbde1f
parent35f013db11ff90ab9c75b028dc58b50d4f06ee42
parent79f60302d659c7719f8b9b6b35629d7450459030
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #25122 from linusg/fix-getrandombytesdevurandom

std.posix: Fix getRandomBytesDevURandom()

2 files changed, 2 insertions(+), 2 deletions(-)

lib/std/c.zig+1-1
...@@ -10353,7 +10353,7 @@ pub extern "c" fn setrlimit64(resource: rlimit_resource, rlim: *const rlimit) c_...@@ -10353,7 +10353,7 @@ pub extern "c" fn setrlimit64(resource: rlimit_resource, rlim: *const rlimit) c_
1035310353
10354pub const arc4random_buf = switch (native_os) {10354pub const arc4random_buf = switch (native_os) {
10355 .linux => if (builtin.abi.isAndroid()) private.arc4random_buf else {},10355 .linux => if (builtin.abi.isAndroid()) private.arc4random_buf else {},
10356 .dragonfly, .netbsd, .freebsd, .solaris, .openbsd, .macos, .ios, .tvos, .watchos, .visionos => private.arc4random_buf,10356 .dragonfly, .netbsd, .freebsd, .solaris, .openbsd, .serenity, .macos, .ios, .tvos, .watchos, .visionos => private.arc4random_buf,
10357 else => {},10357 else => {},
10358};10358};
10359pub const getentropy = switch (native_os) {10359pub const getentropy = switch (native_os) {
lib/std/posix.zig+1-1
...@@ -672,7 +672,7 @@ fn getRandomBytesDevURandom(buf: []u8) !void {...@@ -672,7 +672,7 @@ fn getRandomBytesDevURandom(buf: []u8) !void {
672672
673 const file: fs.File = .{ .handle = fd };673 const file: fs.File = .{ .handle = fd };
674 var file_reader = file.readerStreaming(&.{});674 var file_reader = file.readerStreaming(&.{});
675 file_reader.readSliceAll(buf) catch return error.Unexpected;675 file_reader.interface.readSliceAll(buf) catch return error.Unexpected;
676}676}
677677
678/// Causes abnormal process termination.678/// Causes abnormal process termination.