12 #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
16 #include <bits/alltypes.h>
18 typedef struct __dirstream DIR;
23 unsigned short d_reclen;
28 #define d_fileno d_ino
32 DIR *opendir(const char *);
33 struct dirent *readdir(DIR *);
34 int readdir_r(DIR *__restrict, struct dirent *__restrict, struct dirent **__restrict);
35 void rewinddir(DIR *);
38 int alphasort(const struct dirent **, const struct dirent **);
39 int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **));
41 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
42 void seekdir(DIR *, long);
46 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
56 #define IFTODT(x) ((x)>>12 & 017)
57 #define DTTOIF(x) ((x)<<12)
58 int getdents(int, struct dirent *, size_t);
62 int versionsort(const struct dirent **, const struct dirent **);
65 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
66 #define dirent64 dirent
67 #define readdir64 readdir
68 #define readdir64_r readdir_r
69 #define scandir64 scandir
70 #define alphasort64 alphasort
71 #define versionsort64 versionsort
74 #define getdents64 getdents