Kernel: Separate VFS stat() from open().

It was very confusing that you had to open a FileDescriptor in order to stat
a file. This patch gives VFS a separate stat() function and uses it to
implement the stat() and lstat() syscalls.
This commit is contained in:
Andreas Kling 2019-02-21 16:09:12 +01:00
commit ce3b548077
Notes: sideshowbarker 2024-07-19 15:39:06 +09:00
3 changed files with 20 additions and 8 deletions

View file

@ -24,7 +24,6 @@
#define O_NOFOLLOW 00400000
#define O_CLOEXEC 02000000
#define O_NOFOLLOW_NOERROR 0x4000000
#define O_DONT_OPEN_DEVICE 0x8000000
class Device;
class FileDescriptor;
@ -70,6 +69,7 @@ public:
bool unlink(const String& path, Inode& base, int& error);
bool rmdir(const String& path, Inode& base, int& error);
bool chmod(const String& path, mode_t, Inode& base, int& error);
bool stat(const String& path, int& error, int options, Inode& base, struct stat&);
void register_device(Device&);
void unregister_device(Device&);