diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-02-25 21:19:57 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-02-25 21:21:12 +0100 |
commit | beda4788216509fdf846e5bb6f6000b8b542ca11 (patch) | |
tree | b7ed890f13d5c1629b434fa202b4f1ca9a232c50 /Kernel/MasterPTY.cpp | |
parent | 5af4e622b94a194e3feaea1b3b09229d7a93578b (diff) | |
download | serenity-beda4788216509fdf846e5bb6f6000b8b542ca11.zip |
Kernel: Make syscalls that take a buffer size use ssize_t instead of size_t.
Dealing with the unsigned overflow propagation here just seems unreasonably
error prone. Let's limit ourselves to 2GB buffer sizes instead.
Diffstat (limited to 'Kernel/MasterPTY.cpp')
-rw-r--r-- | Kernel/MasterPTY.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/MasterPTY.cpp b/Kernel/MasterPTY.cpp index d6af396576..819277edd6 100644 --- a/Kernel/MasterPTY.cpp +++ b/Kernel/MasterPTY.cpp @@ -26,14 +26,14 @@ String MasterPTY::pts_name() const return String::format("/dev/pts/%u", m_index); } -ssize_t MasterPTY::read(Process&, byte* buffer, size_t size) +ssize_t MasterPTY::read(Process&, 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, size_t size) +ssize_t MasterPTY::write(Process&, const byte* buffer, ssize_t size) { if (!m_slave) return -EIO; @@ -62,7 +62,7 @@ void MasterPTY::notify_slave_closed(Badge<SlavePTY>) m_slave = nullptr; } -ssize_t MasterPTY::on_slave_write(const byte* data, size_t size) +ssize_t MasterPTY::on_slave_write(const byte* data, ssize_t size) { if (m_closed) return -EIO; |