Kernel: Add . and .. entries to /proc/<pid> directories

This allows to run `cd ..` in one of these directories
This commit is contained in:
Bananymous 2024-12-07 01:37:40 +02:00
parent fbc0319cb6
commit 3bf57e0748
1 changed files with 2 additions and 0 deletions

View File

@ -12,6 +12,8 @@ namespace Kernel
return BAN::Error::from_errno(ENOMEM);
auto inode = BAN::RefPtr<ProcPidInode>::adopt(inode_ptr);
TRY(inode->link_inode(*inode, "."_sv));
TRY(inode->link_inode(static_cast<TmpInode&>(*fs.root_inode()), ".."_sv));
TRY(inode->link_inode(*MUST(ProcROProcessInode::create_new(process, &Process::proc_meminfo, fs, 0400)), "meminfo"_sv));
TRY(inode->link_inode(*MUST(ProcROProcessInode::create_new(process, &Process::proc_cmdline, fs, 0400)), "cmdline"_sv));
TRY(inode->link_inode(*MUST(ProcROProcessInode::create_new(process, &Process::proc_environ, fs, 0400)), "environ"_sv));