diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-29 13:58:40 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-29 13:58:40 +0200 |
commit | 8cbb7f101f1d7d8cf71a9347ddf3a6ca46a97b11 (patch) | |
tree | 75257c71c207ff7910aafd89517c0e31aa970e32 /Kernel/TTY/MasterPTY.cpp | |
parent | 3761bc3ed7bc245e5ba4119136e6e33698b30300 (diff) | |
download | serenity-8cbb7f101f1d7d8cf71a9347ddf3a6ca46a97b11.zip |
Kernel: Have File virtuals take a FileDescriptor& rather than a Process&.
This will allow us to implement different behaviors depending on the role
of the descriptor a File is being accessed through.
Diffstat (limited to 'Kernel/TTY/MasterPTY.cpp')
-rw-r--r-- | Kernel/TTY/MasterPTY.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Kernel/TTY/MasterPTY.cpp b/Kernel/TTY/MasterPTY.cpp index 6c9fd6a6ef..f4fd8b6b98 100644 --- a/Kernel/TTY/MasterPTY.cpp +++ b/Kernel/TTY/MasterPTY.cpp @@ -31,14 +31,14 @@ String MasterPTY::pts_name() const return m_pts_name; } -ssize_t MasterPTY::read(Process&, byte* buffer, ssize_t size) +ssize_t MasterPTY::read(FileDescriptor&, byte* buffer, ssize_t size) { if (!m_slave && m_buffer.is_empty()) return 0; return m_buffer.read(buffer, size); } -ssize_t MasterPTY::write(Process&, const byte* buffer, ssize_t size) +ssize_t MasterPTY::write(FileDescriptor&, const byte* buffer, ssize_t size) { if (!m_slave) return -EIO; @@ -46,14 +46,14 @@ ssize_t MasterPTY::write(Process&, const byte* buffer, ssize_t size) return size; } -bool MasterPTY::can_read(Process&) const +bool MasterPTY::can_read(FileDescriptor&) const { if (!m_slave) return true; return !m_buffer.is_empty(); } -bool MasterPTY::can_write(Process&) const +bool MasterPTY::can_write(FileDescriptor&) const { return true; } @@ -96,9 +96,9 @@ void MasterPTY::close() } } -int MasterPTY::ioctl(Process& process, unsigned request, unsigned arg) +int MasterPTY::ioctl(FileDescriptor& descriptor, unsigned request, unsigned arg) { if (request == TIOCSWINSZ) - return m_slave->ioctl(process, request, arg); + return m_slave->ioctl(descriptor, request, arg); return -EINVAL; } |