mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 22:59:33 +00:00
LibC: Implement scandir(...) to enumerate directories.
I ran into a need for this when running stress-ng against the system. This change implements the full functionality of scandir, where it accepts a selection callback, as well as a comparison callback. These can be used to trim and sort the entries from the directory that we are being asked to enumerate. A test was also included to validate the new functionality.
This commit is contained in:
parent
d4d988532a
commit
331ab52318
Notes:
sideshowbarker
2024-07-18 18:47:14 +09:00
Author: https://github.com/bgianfo
Commit: 331ab52318
Pull-request: https://github.com/SerenityOS/serenity/pull/6810
4 changed files with 95 additions and 0 deletions
|
@ -55,4 +55,8 @@ struct dirent* readdir(DIR*);
|
|||
int readdir_r(DIR*, struct dirent*, struct dirent**);
|
||||
int dirfd(DIR*);
|
||||
|
||||
int scandir(const char* dirp, struct dirent*** namelist,
|
||||
int (*filter)(const struct dirent*),
|
||||
int (*compar)(const struct dirent**, const struct dirent**));
|
||||
|
||||
__END_DECLS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue