1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:07:46 +00:00

Kernel+LibC: Implement FIONREAD ioctl

FIONREAD gets the number of bytes availible to read from a file
descriptor without blocking. I only implemented it for regular files and
sockets
This commit is contained in:
Peter Elliott 2021-07-26 23:06:22 -06:00 committed by Andreas Kling
parent db92e66902
commit 39a77559f1
7 changed files with 38 additions and 4 deletions

View file

@ -38,6 +38,10 @@ public:
bool is_empty() const { return m_empty; }
size_t space_for_writing() const { return m_space_for_writing; }
size_t immediately_readable() const
{
return (m_read_buffer->size - m_read_buffer_index) + m_write_buffer->size;
}
void set_unblock_callback(Function<void()> callback)
{