mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 02:09:24 +00:00
Kernel: Add OpenFileDescriptions::try_enumerate for fallible iteration
This API will allow users to short circuit iteration and properly propagate errors.
This commit is contained in:
parent
aca6c0c031
commit
064b93c2ad
Notes:
sideshowbarker
2024-07-18 22:57:59 +09:00
Author: https://github.com/IdanHo
Commit: 064b93c2ad
Pull-request: https://github.com/SerenityOS/serenity/pull/12754
Reviewed-by: https://github.com/bgianfo ✅
Reviewed-by: https://github.com/elcuco
2 changed files with 9 additions and 0 deletions
|
@ -660,6 +660,7 @@ public:
|
|||
OpenFileDescriptionAndFlags* get_if_valid(size_t i);
|
||||
|
||||
void enumerate(Function<void(const OpenFileDescriptionAndFlags&)>) const;
|
||||
ErrorOr<void> try_enumerate(Function<ErrorOr<void>(const OpenFileDescriptionAndFlags&)>) const;
|
||||
void change_each(Function<void(OpenFileDescriptionAndFlags&)>);
|
||||
|
||||
ErrorOr<ScopedDescriptionAllocation> allocate(int first_candidate_fd = 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue