mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
Kernel: Convert UserOrKernelBuffer callbacks to use AK::Bytes
This commit is contained in:
parent
f3baa5d8c9
commit
668c429900
Notes:
sideshowbarker
2024-07-18 04:56:24 +09:00
Author: https://github.com/bgianfo
Commit: 668c429900
Pull-request: https://github.com/SerenityOS/serenity/pull/9720
11 changed files with 58 additions and 55 deletions
|
@ -31,9 +31,9 @@ bool RandomDevice::can_read(const FileDescription&, size_t) const
|
|||
|
||||
KResultOr<size_t> RandomDevice::read(FileDescription&, u64, UserOrKernelBuffer& buffer, size_t size)
|
||||
{
|
||||
return buffer.write_buffered<256>(size, [&](u8* data, size_t data_size) {
|
||||
get_good_random_bytes({ data, data_size });
|
||||
return data_size;
|
||||
return buffer.write_buffered<256>(size, [&](Bytes bytes) {
|
||||
get_good_random_bytes(bytes);
|
||||
return bytes.size();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue