vfs,libc: support write fds in select

By adding a 'write_ready' interface following the lines of the existing
'read_ready', VFS plugins become able to propagate the (de-)saturation
of I/O buffers to the VFS user. This information is important when using
a non-blocking file descriptor for writing into a TCP socket. Once the
application observes EAGAIN, it expects a subsequent 'select' call to
return as soon as new I/O buffer space becomes available.

Before this patch, the select call would always return under this
condition, causing an unnecessarily busy write loop.

Issue #4697
This commit is contained in:
Norman Feske
2022-12-06 19:11:44 +01:00
committed by Christian Helmuth
parent 5ad98f2b7c
commit ff2176a586
41 changed files with 326 additions and 60 deletions

View File

@ -113,6 +113,8 @@ class Vfs::Rom_file_system : public Single_file_system
}
bool read_ready() override { return true; }
bool write_ready() const override { return false; }
};
typedef Genode::Registered<Vfs_watch_handle> Registered_watch_handle;