diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 05:05:36 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 05:05:36 +0000 |
commit | bea95027e05bb23e240aa264d50f97ed693d369e (patch) | |
tree | 34ebe92523b65cd444f0b368644cf41f8dc9d5ec /src/openbsd.rs | |
parent | c13e4013aa3a3da55c7cf964e89436111aab1054 (diff) | |
parent | 370648b9291c82bbfb0b3efed0b00fe8bae89257 (diff) | |
download | getrandom-android14-mainline-os-statsd-release.tar.gz |
Snap for 10453563 from 370648b9291c82bbfb0b3efed0b00fe8bae89257 to mainline-os-statsd-releaseaml_sta_341710000aml_sta_341615000aml_sta_341511040aml_sta_341410000aml_sta_341311010aml_sta_341114000aml_sta_341111000aml_sta_341010020aml_sta_340912000aml_sta_340911000aml_net_341111030android14-mainline-os-statsd-release
Change-Id: I2f0bb80dc6f43a36adb284d372d8c5066598feb0
Diffstat (limited to 'src/openbsd.rs')
-rw-r--r-- | src/openbsd.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/openbsd.rs b/src/openbsd.rs index c8d28b3..4137173 100644 --- a/src/openbsd.rs +++ b/src/openbsd.rs @@ -10,6 +10,7 @@ use crate::{util_libc::last_os_error, Error}; pub fn getrandom_inner(dest: &mut [u8]) -> Result<(), Error> { + // getentropy(2) was added in OpenBSD 5.6, so we can use it unconditionally. for chunk in dest.chunks_mut(256) { let ret = unsafe { libc::getentropy(chunk.as_mut_ptr() as *mut libc::c_void, chunk.len()) }; if ret == -1 { |