Kernel/SysFS: Expose file size of ACPI tables in /sys/firmware/acpi

It costs us nothing, and some utilities (such as the known file utility)
rely on the exposed file size (after doing lstat on it), to show
anything useful besides saying the file is "empty".
This commit is contained in:
Liav A 2022-10-15 18:14:29 +03:00 committed by Gunnar Beutner
parent 11a5f2c508
commit 462802ef0c
Notes: sideshowbarker 2024-07-17 05:42:02 +09:00

View file

@ -37,6 +37,8 @@ public:
virtual StringView name() const override { return m_table_name->view(); }
virtual ErrorOr<size_t> read_bytes(off_t, size_t, UserOrKernelBuffer&, OpenFileDescription*) const override;
virtual size_t size() const override final { return m_length; }
protected:
ErrorOr<NonnullOwnPtr<KBuffer>> try_to_generate_buffer() const;
ACPISysFSComponent(NonnullOwnPtr<KString> table_name, PhysicalAddress, size_t table_size);