1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 17:18:11 +00:00

Make stat() work on device files again.

FileDescriptor will now keep a pointer to the original inode even after
opening it resolves to a character device.

Fixed up /bin/ls to display major and minor device numbers instead of size
for device files.
This commit is contained in:
Andreas Kling 2019-01-31 05:05:57 +01:00
parent c3cc318028
commit c4fce9b3f9
8 changed files with 25 additions and 10 deletions

View file

@ -6,6 +6,7 @@
#include <AK/ByteBuffer.h>
#include <AK/CircularQueue.h>
#include <AK/Retainable.h>
#include <AK/Badge.h>
class TTY;
class MasterPTY;
@ -68,6 +69,8 @@ public:
ByteBuffer& generator_cache() { return m_generator_cache; }
void set_original_inode(Badge<VFS>, RetainPtr<Inode>&& inode) { m_inode = move(inode); }
private:
friend class VFS;
explicit FileDescriptor(RetainPtr<Inode>&&);