mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
Kernel: Add File, a base class for anything that a FileDescriptor can wrap.
FileDescriptor is getting out of control, and the layering isn't quite right so let's make a File class that everything can inherit from. Then we can stop worrying about all kinds of specifics in FileDescriptor.
This commit is contained in:
31
Kernel/File.cpp
Normal file
31
Kernel/File.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include <Kernel/File.h>
|
||||
#include <Kernel/FileSystem/FileDescriptor.h>
|
||||
|
||||
File::File()
|
||||
{
|
||||
}
|
||||
|
||||
File::~File()
|
||||
{
|
||||
}
|
||||
|
||||
KResultOr<Retained<FileDescriptor>> File::open(int options)
|
||||
{
|
||||
UNUSED_PARAM(options);
|
||||
return FileDescriptor::create(this);
|
||||
}
|
||||
|
||||
void File::close()
|
||||
{
|
||||
}
|
||||
|
||||
int File::ioctl(Process&, unsigned, unsigned)
|
||||
{
|
||||
return -ENOTTY;
|
||||
}
|
||||
|
||||
KResultOr<Region*> File::mmap(Process&, LinearAddress, size_t, size_t)
|
||||
{
|
||||
return KResult(-ENODEV);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user