8 #if __STDC_VERSION__ >= 199901L
9 #define __restrict restrict
10 #elif !defined(__GNUC__)
20 #include <bits/alltypes.h>
22 typedef struct __DIR_s DIR;
28 unsigned short d_reclen;
33 #define d_fileno d_ino
37 DIR *opendir(const char *);
38 struct dirent *readdir(DIR *);
39 int readdir_r(DIR *__restrict, struct dirent *__restrict, struct dirent **__restrict);
40 void rewinddir(DIR *);
41 void seekdir(DIR *, long);
45 int alphasort(const struct dirent **, const struct dirent **);
46 int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **));
48 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
58 #define IFTODT(x) ((x)>>12 & 017)
59 #define DTTOIF(x) ((x)<<12)
63 int versionsort(const struct dirent **, const struct dirent **);
67 int getdents(int, struct dirent *, size_t);
70 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
71 #define dirent64 dirent
72 #define readdir64 readdir
73 #define readdir64_r readdir_r
74 #define scandir64 scandir
75 #define alphasort64 alphasort
76 #define versionsort64 versionsort
80 #define getdents64 getdents