diff --git a/kernel/include/kernel/OpenFileDescriptorSet.h b/kernel/include/kernel/OpenFileDescriptorSet.h index 2c847c1f..4a18a7b6 100644 --- a/kernel/include/kernel/OpenFileDescriptorSet.h +++ b/kernel/include/kernel/OpenFileDescriptorSet.h @@ -42,6 +42,7 @@ namespace Kernel BAN::ErrorOr read_dir_entries(int fd, DirectoryEntryList* list, size_t list_size); BAN::ErrorOr path_of(int) const; + BAN::ErrorOr> inode_of(int); private: struct OpenFileDescription : public BAN::RefCounted diff --git a/kernel/kernel/OpenFileDescriptorSet.cpp b/kernel/kernel/OpenFileDescriptorSet.cpp index 46d238a3..42cfccb5 100644 --- a/kernel/kernel/OpenFileDescriptorSet.cpp +++ b/kernel/kernel/OpenFileDescriptorSet.cpp @@ -216,13 +216,17 @@ namespace Kernel return {}; } - BAN::ErrorOr OpenFileDescriptorSet::path_of(int fd) const { TRY(validate_fd(fd)); return m_open_files[fd]->path.sv(); } + BAN::ErrorOr> OpenFileDescriptorSet::inode_of(int fd) + { + TRY(validate_fd(fd)); + return m_open_files[fd]->inode; + } BAN::ErrorOr OpenFileDescriptorSet::validate_fd(int fd) const {