From 919a91f5265587469f32e06a4e94c129d3e8d5ed Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Wed, 21 Feb 2024 21:52:15 +0300 Subject: [PATCH] Check EPERM only on Linux --- src/linux_android_with_fallback.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/linux_android_with_fallback.rs b/src/linux_android_with_fallback.rs index fa1fe258..821b0510 100644 --- a/src/linux_android_with_fallback.rs +++ b/src/linux_android_with_fallback.rs @@ -20,6 +20,7 @@ fn is_getrandom_available() -> bool { if getrandom_syscall(&[]) < 0 { match last_os_error().raw_os_error() { Some(libc::ENOSYS) => false, // No kernel support + #[cfg(target_os = "linux")] Some(libc::EPERM) => false, // Blocked by seccomp _ => true, }