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:
Andreas Kling 2020-09-06 18:31:51 +02:00
commit 22831033d0
Notes: sideshowbarker 2024-07-19 02:53:06 +09:00
6 changed files with 28 additions and 20 deletions

View file

@ -220,4 +220,11 @@ KResult Socket::shutdown(int how)
return KSuccess;
}
KResult Socket::stat(::stat& st) const
{
memset(&st, 0, sizeof(st));
st.st_mode = S_IFSOCK;
return KSuccess;
}
}