12 #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
16 #include <bits/alltypes.h>
18 #include <bits/dirent.h>
20 typedef struct __dirstream DIR;
22 #define d_fileno d_ino
26 DIR *opendir(const char *);
27 struct dirent *readdir(DIR *);
28 int readdir_r(DIR *__restrict, struct dirent *__restrict, struct dirent **__restrict);
29 void rewinddir(DIR *);
32 int alphasort(const struct dirent **, const struct dirent **);
33 int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **));
35 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
36 void seekdir(DIR *, long);
40 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
50 #define IFTODT(x) ((x)>>12 & 017)
51 #define DTTOIF(x) ((x)<<12)
52 int getdents(int, struct dirent *, size_t);
56 int versionsort(const struct dirent **, const struct dirent **);
59 #if defined(_LARGEFILE64_SOURCE)
60 #define dirent64 dirent
61 #define readdir64 readdir
62 #define readdir64_r readdir_r
63 #define scandir64 scandir
64 #define alphasort64 alphasort
65 #define versionsort64 versionsort
68 #define getdents64 getdents