1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:37:36 +00:00

Add a /proc/PID/fds text files that lists all the fds open in a process.

This commit is contained in:
Andreas Kling 2018-11-01 14:00:28 +01:00
parent 065f0aee35
commit fd03776443
5 changed files with 44 additions and 5 deletions

View file

@ -175,3 +175,15 @@ const TTY* FileHandle::tty() const
return static_cast<const TTY*>(device);
return nullptr;
}
int FileHandle::close()
{
return 0;
}
String FileHandle::absolute_path() const
{
if (isTTY())
return tty()->ttyName();
return VirtualFileSystem::the().absolutePath(m_vnode->inode);
}

View file

@ -11,6 +11,8 @@ public:
explicit FileHandle(RetainPtr<VirtualFileSystem::Node>&&);
~FileHandle();
int close();
Unix::off_t seek(Unix::off_t, int whence);
Unix::ssize_t read(byte*, Unix::size_t);
Unix::ssize_t write(const byte* data, Unix::size_t);
@ -22,7 +24,7 @@ public:
ByteBuffer readEntireFile();
String absolutePath() const;
String absolute_path() const;
bool isDirectory() const;