1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:57:35 +00:00

LibCore: Keep the raw inode number value in DirectoryEntry

This will be used later on by other userspace programs that need it.
This commit is contained in:
Liav A 2023-08-05 03:37:15 +03:00 committed by Jelle Raaijmakers
parent 5efb91ec06
commit 93ef955597
2 changed files with 3 additions and 0 deletions

View file

@ -68,6 +68,7 @@ DirectoryEntry DirectoryEntry::from_stat(DIR* d, dirent const& de)
return DirectoryEntry {
.type = directory_entry_type_from_stat(statbuf.st_mode),
.name = de.d_name,
.inode_number = de.d_ino,
};
}
@ -77,6 +78,7 @@ DirectoryEntry DirectoryEntry::from_dirent(dirent const& de)
return DirectoryEntry {
.type = directory_entry_type_from_posix(de.d_type),
.name = de.d_name,
.inode_number = de.d_ino,
};
}
#endif

View file

@ -26,6 +26,7 @@ struct DirectoryEntry {
Type type;
// FIXME: Once we have a special Path string class, use that.
DeprecatedString name;
ino_t inode_number;
static DirectoryEntry from_dirent(dirent const&);
static DirectoryEntry from_stat(DIR*, dirent const&);