mirror of
https://github.com/RGBCube/serenity
synced 2025-05-21 14:55:07 +00:00
Allow character devices to block write attempts until there is more space.
This commit is contained in:
parent
49b63281a0
commit
e452303c66
21 changed files with 39 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue