1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:47:35 +00:00

Kernel: Add a Process::FileDescriptions::get_if_valid(index) API

Note that this is not the same as ::at(index), which has a different
precondition ("allocated" vs "valid").
This commit is contained in:
Ali Mohammad Pur 2021-08-16 06:32:48 +04:30 committed by Andreas Kling
parent c1ffc17134
commit e9feced041
2 changed files with 26 additions and 0 deletions

View file

@ -643,6 +643,9 @@ public:
const FileDescriptionAndFlags& at(size_t i) const;
FileDescriptionAndFlags& at(size_t i);
FileDescriptionAndFlags const* get_if_valid(size_t i) const;
FileDescriptionAndFlags* get_if_valid(size_t i);
void enumerate(Function<void(const FileDescriptionAndFlags&)>) const;
void change_each(Function<void(FileDescriptionAndFlags&)>);