mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 16:46:08 +00:00
Kernel+LibC: Make get_dir_entries syscall retriable
The get_dir_entries syscall failed if the serialized form of all the directory entries together was too large to fit in its temporary buffer. Now the kernel uses a fixed size buffer, that is flushed to an output buffer when it is full. If this flushing operation fails because there is not enough space available, the syscall will return -EINVAL. That error code is then used in userspace as a signal to allocate a larger buffer and retry the syscall.
This commit is contained in:
parent
c7b60164ed
commit
b00cdf8ed8
Notes:
sideshowbarker
2024-07-18 18:18:23 +09:00
Author: https://github.com/Maato
Commit: b00cdf8ed8
Pull-request: https://github.com/SerenityOS/serenity/pull/7035
Issue: https://github.com/SerenityOS/serenity/issues/7025
Reviewed-by: https://github.com/alimpfard
3 changed files with 65 additions and 21 deletions
|
@ -129,6 +129,7 @@ public:
|
|||
|
||||
size_t size() const { return m_offset; }
|
||||
size_t remaining() const { return m_bytes.size() - m_offset; }
|
||||
void reset() { m_offset = 0; }
|
||||
|
||||
private:
|
||||
size_t m_offset { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue