3 # include <dirstream.h>
5 # include <dirent/dirent.h>
10 struct scandir_cancel_struct
17 /* Now define the internal interfaces. */
18 extern DIR *__opendir (const char *__name
) attribute_hidden
;
19 extern DIR *__opendirat (int dfd
, const char *__name
) attribute_hidden
;
20 extern DIR *__fdopendir (int __fd
) attribute_hidden
;
21 extern int __closedir (DIR *__dirp
) attribute_hidden
;
22 extern struct dirent
*__readdir (DIR *__dirp
) attribute_hidden
;
23 extern struct dirent64
*__readdir64 (DIR *__dirp
);
24 libc_hidden_proto (__readdir64
)
25 extern int __readdir_r (DIR *__dirp
, struct dirent
*__entry
,
26 struct dirent
**__result
);
27 extern int __readdir64_r (DIR *__dirp
, struct dirent64
*__entry
,
28 struct dirent64
**__result
);
29 extern int __scandir64 (const char * __dir
,
30 struct dirent64
*** __namelist
,
31 int (*__selector
) (const struct dirent64
*),
32 int (*__cmp
) (const struct dirent64
**,
33 const struct dirent64
**));
34 extern __ssize_t
__getdirentries (int __fd
, char *__restrict __buf
,
36 __off_t
*__restrict __basep
)
37 __THROW
__nonnull ((2, 4));
38 extern __ssize_t
__getdents (int __fd
, char *__buf
, size_t __nbytes
)
40 extern __ssize_t
__getdents64 (int __fd
, char *__buf
, size_t __nbytes
)
42 extern int __alphasort64 (const struct dirent64
**a
, const struct dirent64
**b
)
44 extern int __versionsort64 (const struct dirent64
**a
,
45 const struct dirent64
**b
)
47 extern DIR *__alloc_dir (int fd
, bool close_fd
, int flags
,
48 const struct stat64
*statp
) attribute_hidden
;
49 extern __typeof (rewinddir
) __rewinddir
;
50 extern __typeof (seekdir
) __seekdir
;
51 extern __typeof (dirfd
) __dirfd
;
52 libc_hidden_proto (dirfd
);
54 extern void __scandir_cancel_handler (void *arg
) attribute_hidden
;
55 extern int __scandir_tail (DIR *dp
,
56 struct dirent
***namelist
,
57 int (*select
) (const struct dirent
*),
58 int (*cmp
) (const struct dirent
**,
59 const struct dirent
**))
61 # if !_DIRENT_MATCHES_DIRENT64
62 extern int __scandir_tail (DIR *dp
,
63 struct dirent
***namelist
,
64 int (*select
) (const struct dirent
*),
65 int (*cmp
) (const struct dirent
**,
66 const struct dirent
**))
69 extern int __scandir64_tail (DIR *dp
,
70 struct dirent64
***namelist
,
71 int (*select
) (const struct dirent64
*),
72 int (*cmp
) (const struct dirent64
**,
73 const struct dirent64
**))
76 libc_hidden_proto (__rewinddir
)
77 extern __typeof (scandirat
) __scandirat
;
79 # if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
80 extern __typeof (__rewinddir
) __rewinddir attribute_hidden
;