1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:28:13 +00:00

Add basic symlink support.

- sys$readlink + readlink()
- Add a /proc/PID/exe symlink to the process's executable.
- Print symlink contents in ls output.
- Some work on plumbing options into VFS::open().
This commit is contained in:
Andreas Kling 2018-10-28 14:11:51 +01:00
parent 1d4af51250
commit 97726862dd
20 changed files with 140 additions and 46 deletions

View file

@ -96,6 +96,16 @@ ByteBuffer procfs$pid_stack(Task& task)
return buffer;
}
ByteBuffer procfs$pid_exe(Task& task)
{
InodeIdentifier inode;
{
InterruptDisabler disabler;
inode = task.executableInode();
}
return VirtualFileSystem::the().absolutePath(inode).toByteBuffer();
}
void ProcFileSystem::addProcess(Task& task)
{
ASSERT_INTERRUPTS_DISABLED();
@ -105,6 +115,8 @@ void ProcFileSystem::addProcess(Task& task)
m_pid2inode.set(task.pid(), dir.index());
addFile(createGeneratedFile("vm", [&task] { return procfs$pid_vm(task); }), dir.index());
addFile(createGeneratedFile("stack", [&task] { return procfs$pid_stack(task); }), dir.index());
if (task.executableInode().isValid())
addFile(createGeneratedFile("exe", [&task] { return procfs$pid_exe(task); }, 00120777), dir.index());
}
void ProcFileSystem::removeProcess(Task& task)