userspace/libc: implement alphasort, fdopendir, opendir, posix_getdents, readdir & scandir

Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
2025-02-14 02:17:06 +02:00
parent d0a8d9dd62
commit 92ef18b412
2 changed files with 127 additions and 12 deletions

View File

@ -58,16 +58,16 @@ extern "C"
#define DT_SHM
#define DT_TMO
int alphasort(const struct dirent **, const struct dirent **);
int alphasort(const struct dirent **d1, const struct dirent **d2);
int closedir(DIR *dirp);
int dirfd(DIR *dirp);
DIR *fdopendir(int);
DIR *opendir(const char *);
ssize_t posix_getdents(int, void *, size_t, int);
struct dirent *readdir(DIR *);
DIR *fdopendir(int fd);
DIR *opendir(const char *dirname);
ssize_t posix_getdents(int fildes, void *buf, size_t nbyte, int flags);
struct dirent *readdir(DIR *dirp);
int readdir_r(DIR *restrict, struct dirent *restrict, struct dirent **restrict);
void rewinddir(DIR *);
int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **));
int scandir(const char *dir, struct dirent ***namelist, int (*sel)(const struct dirent *), int (*compar)(const struct dirent **, const struct dirent **));
void seekdir(DIR *, long);
long telldir(DIR *);