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 *);
36 void seekdir(DIR *, long);
40 int alphasort(const struct dirent **, const struct dirent **);
41 int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **));
43 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
53 #define IFTODT(x) ((x)>>12 & 017)
54 #define DTTOIF(x) ((x)<<12)
55 int getdents(int, struct dirent *, size_t);
59 int versionsort(const struct dirent **, const struct dirent **);
62 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
63 #define dirent64 dirent
64 #define readdir64 readdir
65 #define readdir64_r readdir_r
66 #define scandir64 scandir
67 #define alphasort64 alphasort
68 #define versionsort64 versionsort
71 #define getdents64 getdents