diff options
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r-- | Kernel/FileSystem/ProcFS.cpp | 15 | ||||
-rw-r--r-- | Kernel/FileSystem/ProcFS.h | 3 |
2 files changed, 12 insertions, 6 deletions
diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp index e6a034e8a6..fd88f671a4 100644 --- a/Kernel/FileSystem/ProcFS.cpp +++ b/Kernel/FileSystem/ProcFS.cpp @@ -99,11 +99,6 @@ KResult ProcFSInode::chown(UserID, GroupID) return EPERM; } -KResult ProcFSInode::truncate(u64) -{ - return EPERM; -} - KResultOr<NonnullRefPtr<ProcFSGlobalInode>> ProcFSGlobalInode::try_create(const ProcFS& fs, const ProcFSExposedComponent& component) { return adopt_nonnull_ref_or_enomem(new (nothrow) ProcFSGlobalInode(fs, component)); @@ -151,6 +146,16 @@ KResultOr<NonnullRefPtr<Inode>> ProcFSGlobalInode::lookup(StringView) VERIFY_NOT_REACHED(); } +KResult ProcFSGlobalInode::truncate(u64 size) +{ + return m_associated_component->truncate(size); +} + +KResult ProcFSGlobalInode::set_mtime(time_t time) +{ + return m_associated_component->set_mtime(time); +} + InodeMetadata ProcFSGlobalInode::metadata() const { MutexLocker locker(m_inode_lock); diff --git a/Kernel/FileSystem/ProcFS.h b/Kernel/FileSystem/ProcFS.h index 1be5b2f1c6..966cfd55a4 100644 --- a/Kernel/FileSystem/ProcFS.h +++ b/Kernel/FileSystem/ProcFS.h @@ -62,7 +62,6 @@ protected: virtual KResult remove_child(const StringView& name) override final; virtual KResult chmod(mode_t) override final; virtual KResult chown(UserID, GroupID) override final; - virtual KResult truncate(u64) override final; }; class ProcFSGlobalInode : public ProcFSInode { @@ -84,6 +83,8 @@ protected: virtual InodeMetadata metadata() const override; virtual KResult traverse_as_directory(Function<bool(FileSystem::DirectoryEntryView const&)>) const override; virtual KResultOr<NonnullRefPtr<Inode>> lookup(StringView) override; + virtual KResult truncate(u64) override final; + virtual KResult set_mtime(time_t) override final; NonnullRefPtr<ProcFSExposedComponent> m_associated_component; }; |