2019-02-16 00:47:20 +01:00
|
|
|
#include "CharacterDevice.h"
|
|
|
|
|
#include <LibC/errno_numbers.h>
|
|
|
|
|
|
2019-02-17 10:38:07 +01:00
|
|
|
Device::Device(unsigned major, unsigned minor)
|
|
|
|
|
: m_major(major)
|
|
|
|
|
, m_minor(minor)
|
|
|
|
|
{
|
|
|
|
|
VFS::the().register_device(*this);
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-16 00:47:20 +01:00
|
|
|
Device::~Device()
|
|
|
|
|
{
|
2019-02-17 10:38:07 +01:00
|
|
|
VFS::the().unregister_device(*this);
|
2019-02-16 00:47:20 +01:00
|
|
|
}
|
|
|
|
|
|
2019-03-06 22:14:31 +01:00
|
|
|
KResultOr<Retained<FileDescriptor>> Device::open(int options)
|
2019-02-16 00:47:20 +01:00
|
|
|
{
|
2019-04-24 02:20:14 +02:00
|
|
|
UNUSED_PARAM(options);
|
|
|
|
|
return FileDescriptor::create(this);
|
2019-02-16 00:47:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Device::close()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int Device::ioctl(Process&, unsigned, unsigned)
|
|
|
|
|
{
|
|
|
|
|
return -ENOTTY;
|
|
|
|
|
}
|