1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-21 15:55:07 +00:00

Add mechanism to expose kernel variables to userspace via ProcFS.

Only booleans are supported at first. More types can be added easily.
Use this to add /proc/sys/wm_flash_flush which when enabled flashes pending
screen flush rects in yellow before they happen.
This commit is contained in:
Andreas Kling 2019-01-18 15:01:40 +01:00
parent 9454c5dd52
commit f7cc454162
8 changed files with 121 additions and 29 deletions

View file

@ -167,9 +167,10 @@ ssize_t FileDescriptor::write(Process& process, const byte* data, size_t size)
// FIXME: What should happen to m_currentOffset?
return m_device->write(process, data, size);
}
// FIXME: Implement non-device writes.
ASSERT_NOT_REACHED();
return -1;
ASSERT(m_inode);
ssize_t nwritten = m_inode->write(ByteBuffer::wrap((byte*)data, size));
m_current_offset += nwritten;
return nwritten;
}
bool FileDescriptor::can_write(Process& process)