commit 13f31bb3c319813cbc3ed461ad9a97ec1c379f11 (tree)
parent b600b6e5e08bc443ef9742b36d51c95715c8150a
Author: Meghan Denny <hello@nektro.net>
Date: Wed, 11 Feb 2026 15:29:51 -0800
std/c: glibc has supported arc4random_buf since 2.36
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/std/c.zig b/lib/std/c.zig
@@ -10357,7 +10357,10 @@ pub extern "c" fn sendfile64(out_fd: fd_t, in_fd: fd_t, offset: ?*i64, count: us
pub extern "c" fn setrlimit64(resource: rlimit_resource, rlim: *const rlimit) c_int;
pub const arc4random_buf = switch (native_os) {
- .linux => if (builtin.abi.isAndroid()) private.arc4random_buf else {},
+ .linux => if (builtin.abi.isAndroid() or
+ (builtin.abi.isGnu() and versionCheck(.{ .major = 2, .minor = 36, .patch = 0 })))
+ private.arc4random_buf
+ else {},
.dragonfly, .netbsd, .freebsd, .illumos, .openbsd, .serenity, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => private.arc4random_buf,
else => {},
};