diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:06:04 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:06:04 +0000 |
commit | 2f0649f6fe411d7e07c8d56cf8ea56db53536da8 (patch) | |
tree | 778611fb52176dce1ad06c68e87b2cb348ca0f7b /usr/include/dirent.h | |
parent | Initial commit. (diff) | |
download | klibc-2f0649f6fe411d7e07c8d56cf8ea56db53536da8.tar.xz klibc-2f0649f6fe411d7e07c8d56cf8ea56db53536da8.zip |
Adding upstream version 2.0.13.upstream/2.0.13upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'usr/include/dirent.h')
-rw-r--r-- | usr/include/dirent.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/usr/include/dirent.h b/usr/include/dirent.h new file mode 100644 index 0000000..43df503 --- /dev/null +++ b/usr/include/dirent.h @@ -0,0 +1,43 @@ +/* + * dirent.h + */ + +#ifndef _DIRENT_H +#define _DIRENT_H + +#include <klibc/compiler.h> +#include <klibc/extern.h> +#include <klibc/sysconfig.h> +#include <sys/dirent.h> + +struct _IO_dir { + int __fd; + +#ifdef __KLIBC_DIRENT_INTERNALS + /* These fields for internal use only */ + + size_t bytes_left; + struct dirent *next; + /* Declaring this as an array of struct enforces correct alignment */ + struct dirent buffer[_KLIBC_BUFSIZ / sizeof(struct dirent)]; +#endif +}; +typedef struct _IO_dir DIR; + +__extern DIR *fdopendir(int); +__extern DIR *opendir(const char *); +__extern struct dirent *readdir(DIR *); +__extern int closedir(DIR *); +__static_inline int dirfd(DIR * __d) +{ + return __d->__fd; +} + +__extern int scandir(const char *, struct dirent ***, + int (*)(const struct dirent *), + int (*)(const struct dirent **, + const struct dirent **)); + +__extern int alphasort(const struct dirent **, const struct dirent **); + +#endif /* _DIRENT_H */ |