mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 21:52:45 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
	
		
			452 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
	
		
			452 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #include <Kernel/Devices/Device.h>
 | |
| #include <Kernel/FileSystem/VirtualFileSystem.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);
 | |
| }
 | |
| 
 | |
| String Device::absolute_path(FileDescriptor&) const
 | |
| {
 | |
|     return String::format("device:%u,%u (%s)", m_major, m_minor, class_name());
 | |
| }
 | 
