12 #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
16 #include <bits/alltypes.h>
18 typedef struct __dirstream
DIR;
24 unsigned short d_reclen
;
29 #define d_fileno d_ino
33 DIR *opendir(const char *);
34 struct dirent
*readdir(DIR *);
35 int readdir_r(DIR *__restrict
, struct dirent
*__restrict
, struct dirent
**__restrict
);
36 void rewinddir(DIR *);
37 void seekdir(DIR *, long);
41 int alphasort(const struct dirent
**, const struct dirent
**);
42 int scandir(const char *, struct dirent
***, int (*)(const struct dirent
*), int (*)(const struct dirent
**, const struct dirent
**));
44 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
54 #define IFTODT(x) ((x)>>12 & 017)
55 #define DTTOIF(x) ((x)<<12)
56 int getdents(int, struct dirent
*, size_t);
60 int versionsort(const struct dirent
**, const struct dirent
**);
63 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
64 #define dirent64 dirent
65 #define readdir64 readdir
66 #define readdir64_r readdir_r
67 #define scandir64 scandir
68 #define alphasort64 alphasort
69 #define versionsort64 versionsort
72 #define getdents64 getdents