mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-21 16:39:39 +00:00
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:
committed by
Christian Helmuth
parent
5ad98f2b7c
commit
ff2176a586
@ -973,6 +973,14 @@ class Vfs::Dir_file_system : public File_system
|
||||
return handle->fs().read_ready(handle);
|
||||
}
|
||||
|
||||
bool write_ready(Vfs_handle const &handle) const override
|
||||
{
|
||||
if (&handle.fs() == this)
|
||||
return false;
|
||||
|
||||
return handle.fs().write_ready(handle);
|
||||
}
|
||||
|
||||
bool notify_read_ready(Vfs_handle *handle) override
|
||||
{
|
||||
if (&handle->fs() == this)
|
||||
|
Reference in New Issue
Block a user