Kernel: Make sys_.*at use VFS relative path finding

This commit is contained in:
2024-09-14 21:15:58 +03:00
parent ea4ec2eafc
commit 8956835d95
6 changed files with 124 additions and 158 deletions

View File

@@ -47,10 +47,23 @@ namespace Kernel
return *this;
}
BAN::ErrorOr<File> clone() const
{
File result;
result.inode = inode;
TRY(result.canonical_path.append(canonical_path));
return BAN::move(result);
}
BAN::RefPtr<Inode> inode;
BAN::String canonical_path;
};
File root_file()
{
return File(root_inode(), "/"_sv);
}
BAN::ErrorOr<File> file_from_relative_path(const File& parent, const Credentials&, BAN::StringView, int);
BAN::ErrorOr<File> file_from_absolute_path(const Credentials& credentials, BAN::StringView path, int flags)
{