mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:47:34 +00:00
Kernel: Add explicit offset parameter to File::read etc
This commit is contained in:
parent
68c7ca7d3b
commit
a3edeb5868
45 changed files with 199 additions and 183 deletions
|
@ -38,18 +38,18 @@ RandomDevice::~RandomDevice()
|
|||
{
|
||||
}
|
||||
|
||||
bool RandomDevice::can_read(const FileDescription&) const
|
||||
bool RandomDevice::can_read(const FileDescription&, size_t) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
ssize_t RandomDevice::read(FileDescription&, u8* buffer, ssize_t size)
|
||||
ssize_t RandomDevice::read(FileDescription&, size_t, u8* buffer, ssize_t size)
|
||||
{
|
||||
get_good_random_bytes(buffer, size);
|
||||
return size;
|
||||
}
|
||||
|
||||
ssize_t RandomDevice::write(FileDescription&, const u8*, ssize_t size)
|
||||
ssize_t RandomDevice::write(FileDescription&, size_t, const u8*, ssize_t size)
|
||||
{
|
||||
// FIXME: Use input for entropy? I guess that could be a neat feature?
|
||||
return min(PAGE_SIZE, size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue