mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 10:15:07 +00:00
Kernel: Virtualize the File::stat() operation
Instead of FileDescriptor branching on the type of File it's wrapping, add a File::stat() function that can be overridden to provide custom behavior for the stat syscalls.
This commit is contained in:
parent
5444cabd39
commit
22831033d0
6 changed files with 28 additions and 20 deletions
|
@ -166,4 +166,11 @@ String FIFO::absolute_path(const FileDescription&) const
|
|||
return String::format("fifo:%u", m_fifo_id);
|
||||
}
|
||||
|
||||
KResult FIFO::stat(::stat& st) const
|
||||
{
|
||||
memset(&st, 0, sizeof(st));
|
||||
st.st_mode = S_IFIFO;
|
||||
return KSuccess;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue