1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 08:07:45 +00:00

Kernel: Convert random bytes interface to use AK::Bytes

This commit is contained in:
Brian Gianforcaro 2021-08-31 23:28:47 -07:00 committed by Andreas Kling
parent 0678ac265c
commit f3baa5d8c9
5 changed files with 20 additions and 19 deletions

View file

@ -24,7 +24,7 @@ KResultOr<FlatPtr> Process::sys$getrandom(Userspace<void*> buffer, size_t buffer
if (!data_buffer.has_value())
return EFAULT;
auto result = data_buffer.value().write_buffered<1024>(buffer_size, [&](u8* buffer, size_t buffer_bytes) {
get_good_random_bytes(buffer, buffer_bytes);
get_good_random_bytes({ buffer, buffer_bytes });
return buffer_bytes;
});
if (result.is_error())