1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 19: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:
Andreas Kling 2020-09-06 18:31:51 +02:00
parent 5444cabd39
commit 22831033d0
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;
}
}