mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:07:35 +00:00
Kernel: Add Inode::read_until_filled_or_end
The existing `read_entire` is quite slow due to allocating and copying multiple times, but it is simultaneously quite hard to get rid of in a single step. As a replacement, add a new function that reads as much as possible directly into a user-provided buffer.
This commit is contained in:
parent
c403f8e92c
commit
acd8c8dba4
2 changed files with 16 additions and 0 deletions
|
@ -57,6 +57,7 @@ public:
|
|||
|
||||
ErrorOr<size_t> write_bytes(off_t, size_t, UserOrKernelBuffer const& data, OpenFileDescription*);
|
||||
ErrorOr<size_t> read_bytes(off_t, size_t, UserOrKernelBuffer& buffer, OpenFileDescription*) const;
|
||||
ErrorOr<size_t> read_until_filled_or_end(off_t, size_t, UserOrKernelBuffer buffer, OpenFileDescription*) const;
|
||||
|
||||
virtual ErrorOr<void> attach(OpenFileDescription&) { return {}; }
|
||||
virtual void detach(OpenFileDescription&) { }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue