mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 08:06:09 +00:00
Allow character devices to block write attempts until there is more space.
This commit is contained in:
@@ -165,12 +165,14 @@ ssize_t FileDescriptor::write(const byte* data, size_t size)
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool FileDescriptor::can_write()
|
||||
bool FileDescriptor::can_write(Process& process)
|
||||
{
|
||||
if (is_fifo()) {
|
||||
ASSERT(fifo_direction() == FIFO::Writer);
|
||||
return m_fifo->can_write();
|
||||
}
|
||||
if (m_vnode->isCharacterDevice())
|
||||
return m_vnode->characterDevice()->can_write(process);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user