summaryrefslogtreecommitdiff
path: root/Kernel/TTY/TTY.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-08-04 18:02:23 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-04 18:17:16 +0200
commit7a3ab6c517649e9dfdd50085f10492212b0bcb18 (patch)
treef251cfc69ebe5f253c1e900c10b9485136b315cd /Kernel/TTY/TTY.h
parent58feebeed28bab04e7b462f7cd3beb81984f116e (diff)
downloadserenity-7a3ab6c517649e9dfdd50085f10492212b0bcb18.zip
Kernel: Make File::write() and File::read() return KResultOr<size_t>
Instead of returning a ssize_t where negative values mean error, we now return KResultOr<size_t> and use the error state to report errors exclusively.
Diffstat (limited to 'Kernel/TTY/TTY.h')
-rw-r--r--Kernel/TTY/TTY.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/TTY/TTY.h b/Kernel/TTY/TTY.h
index 46268000ce..7644a5318a 100644
--- a/Kernel/TTY/TTY.h
+++ b/Kernel/TTY/TTY.h
@@ -39,8 +39,8 @@ class TTY : public CharacterDevice {
public:
virtual ~TTY() override;
- virtual ssize_t read(FileDescription&, size_t, u8*, ssize_t) override;
- virtual ssize_t write(FileDescription&, size_t, const u8*, ssize_t) override;
+ virtual KResultOr<size_t> read(FileDescription&, size_t, u8*, size_t) override;
+ virtual KResultOr<size_t> write(FileDescription&, size_t, const u8*, size_t) override;
virtual bool can_read(const FileDescription&, size_t) const override;
virtual bool can_write(const FileDescription&, size_t) const override;
virtual int ioctl(FileDescription&, unsigned request, FlatPtr arg) override final;