12 #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
16 #include <bits/alltypes.h>
18 typedef struct __dirstream
DIR;
20 #define _DIRENT_HAVE_D_RECLEN
21 #define _DIRENT_HAVE_D_OFF
22 #define _DIRENT_HAVE_D_TYPE
27 unsigned short d_reclen
;
32 #define d_fileno d_ino
36 DIR *opendir(const char *);
37 struct dirent
*readdir(DIR *);
38 int readdir_r(DIR *__restrict
, struct dirent
*__restrict
, struct dirent
**__restrict
);
39 void rewinddir(DIR *);
42 int alphasort(const struct dirent
**, const struct dirent
**);
43 int scandir(const char *, struct dirent
***, int (*)(const struct dirent
*), int (*)(const struct dirent
**, const struct dirent
**));
45 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
46 void seekdir(DIR *, long);
50 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
60 #define IFTODT(x) ((x)>>12 & 017)
61 #define DTTOIF(x) ((x)<<12)
62 int getdents(int, struct dirent
*, size_t);
66 int versionsort(const struct dirent
**, const struct dirent
**);
69 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
70 #define dirent64 dirent
71 #define readdir64 readdir
72 #define readdir64_r readdir_r
73 #define scandir64 scandir
74 #define alphasort64 alphasort
75 #define versionsort64 versionsort
78 #define getdents64 getdents