mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 10:44:57 +00:00
Kernel: Allow getting a Device from a FileDescription
Like we already do for other kinds of files.
This commit is contained in:
parent
35b0f10f20
commit
3393b78623
2 changed files with 16 additions and 0 deletions
|
@ -172,6 +172,20 @@ bool FileDescription::is_device() const
|
|||
return m_file->is_device();
|
||||
}
|
||||
|
||||
const Device* FileDescription::device() const
|
||||
{
|
||||
if (!is_device())
|
||||
return nullptr;
|
||||
return static_cast<const Device*>(m_file.ptr());
|
||||
}
|
||||
|
||||
Device* FileDescription::device()
|
||||
{
|
||||
if (!is_device())
|
||||
return nullptr;
|
||||
return static_cast<Device*>(m_file.ptr());
|
||||
}
|
||||
|
||||
bool FileDescription::is_tty() const
|
||||
{
|
||||
return m_file->is_tty();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue