Device.cpp 479 B

12345678910111213141516171819202122232425262728
  1. #include "CharacterDevice.h"
  2. #include <LibC/errno_numbers.h>
  3. Device::Device(unsigned major, unsigned minor)
  4. : m_major(major)
  5. , m_minor(minor)
  6. {
  7. VFS::the().register_device(*this);
  8. }
  9. Device::~Device()
  10. {
  11. VFS::the().unregister_device(*this);
  12. }
  13. RetainPtr<FileDescriptor> Device::open(int& error, int options)
  14. {
  15. return VFS::the().open(*this, error, options);
  16. }
  17. void Device::close()
  18. {
  19. }
  20. int Device::ioctl(Process&, unsigned, unsigned)
  21. {
  22. return -ENOTTY;
  23. }