Kernel: Make File::stat() & friends return Error<struct stat>

Instead of making the caller provide a stat buffer, let's just return
one as a value.
This commit is contained in:
Andreas Kling 2021-12-17 11:22:27 +01:00
commit 0ae8702692
Notes: sideshowbarker 2024-07-17 22:40:06 +09:00
10 changed files with 19 additions and 20 deletions

View file

@ -104,7 +104,7 @@ public:
// ^File
virtual ErrorOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override final;
virtual ErrorOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override final;
virtual ErrorOr<void> stat(::stat&) const override;
virtual ErrorOr<struct stat> stat() const override;
virtual ErrorOr<NonnullOwnPtr<KString>> pseudo_path(const OpenFileDescription&) const override = 0;
bool has_receive_timeout() const { return m_receive_timeout != Time::zero(); }