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.
This commit is contained in:
Andreas Kling 2020-08-04 18:02:23 +02:00
commit 7a3ab6c517
Notes: sideshowbarker 2024-07-19 04:18:56 +09:00
58 changed files with 223 additions and 229 deletions

View file

@ -44,8 +44,8 @@ public:
// ^CharacterDevice
virtual bool can_read(const FileDescription&, size_t) const 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_write(const FileDescription&, size_t) const override { return true; }
virtual const char* purpose() const override { return class_name(); }