libc: Add fscandir(), fscandir_b(), scandirat_b().

While here, clean up scandir() a bit and improve the documentation.

MFC after:	never
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D50935
This commit is contained in:
Dag-Erling Smørgrav
2025-06-20 13:10:23 +02:00
parent 609720ed97
commit deeebfdeca
8 changed files with 410 additions and 42 deletions
+13
View File
@@ -130,9 +130,22 @@ int scandir_b(const char *, struct dirent ***,
#endif
#endif
#if __BSD_VISIBLE
int fscandir(int, struct dirent ***,
int (*)(const struct dirent *), int (*)(const struct dirent **,
const struct dirent **));
#ifdef __BLOCKS__
int fscandir_b(int, struct dirent ***,
int (^)(const struct dirent *),
int (^)(const struct dirent **, const struct dirent **));
#endif
int scandirat(int, const char *, struct dirent ***,
int (*)(const struct dirent *), int (*)(const struct dirent **,
const struct dirent **));
#ifdef __BLOCKS__
int scandirat_b(int, const char *, struct dirent ***,
int (^)(const struct dirent *),
int (^)(const struct dirent **, const struct dirent **));
#endif
#endif
#if __XSI_VISIBLE
void seekdir(DIR *, long);