Skip to content

Commit

Permalink
Check EPERM only on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov authored Feb 21, 2024
1 parent 94e6986 commit 919a91f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/linux_android_with_fallback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit 919a91f

Please sign in to comment.