1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-07 09:27:35 +00:00

Kernel: Have devices automagically register themselves with the VFS.

This commit is contained in:
Andreas Kling 2019-02-17 10:38:07 +01:00
parent e74c833af3
commit b6bf26430d
4 changed files with 11 additions and 24 deletions

View file

@ -1,8 +1,16 @@
#include "CharacterDevice.h"
#include <LibC/errno_numbers.h>
Device::Device(unsigned major, unsigned minor)
: m_major(major)
, m_minor(minor)
{
VFS::the().register_device(*this);
}
Device::~Device()
{
VFS::the().unregister_device(*this);
}
RetainPtr<FileDescriptor> Device::open(int& error, int options)