Kernel: Rewrite all read/write functions to use BAN::ByteSpan
This allows us to not work with raw pointers and use sized containers for reading and writing.
This commit is contained in:
@@ -12,10 +12,10 @@ namespace Kernel
|
||||
return BAN::RefPtr<ZeroDevice>::adopt(result);
|
||||
}
|
||||
|
||||
BAN::ErrorOr<size_t> ZeroDevice::read_impl(off_t, void* buffer, size_t bytes)
|
||||
BAN::ErrorOr<size_t> ZeroDevice::read_impl(off_t, BAN::ByteSpan buffer)
|
||||
{
|
||||
memset(buffer, 0, bytes);
|
||||
return bytes;
|
||||
memset(buffer.data(), 0, buffer.size());
|
||||
return buffer.size();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user