Kernel: Add InodeFile, a File subclass for regular files.

Finally everything that can be held by a FileDescriptor actually inherits
from the File class.
This commit is contained in:
Andreas Kling 2019-05-30 13:39:17 +02:00
commit 08926e59b3
Notes: sideshowbarker 2024-07-19 13:50:22 +09:00
9 changed files with 151 additions and 133 deletions

View file

@ -6,6 +6,7 @@
#include <AK/Types.h>
#include <Kernel/KResult.h>
#include <Kernel/LinearAddress.h>
#include <Kernel/UnixTypes.h>
class FileDescriptor;
class Process;
@ -28,10 +29,13 @@ public:
virtual String absolute_path(FileDescriptor&) const = 0;
virtual KResult truncate(off_t) { return KResult(-EINVAL); }
virtual const char* class_name() const = 0;
virtual bool is_seekable() const { return false; }
virtual bool is_inode() const { return false; }
virtual bool is_shared_memory() const { return false; }
virtual bool is_fifo() const { return false; }
virtual bool is_device() const { return false; }