2012-03-02 Kees Cook <keescook@chromium.org>
[glibc.git] / include / dirent.h
blob8e4823ce7371991062e34ba95598d56562760c42
1 #ifndef _DIRENT_H
2 # ifndef _ISOMAC
3 # include <dirstream.h>
4 # endif
5 # include <dirent/dirent.h>
6 # ifndef _ISOMAC
7 # include <sys/stat.h>
8 # include <stdbool.h>
10 struct scandir_cancel_struct
12 DIR *dp;
13 void *v;
14 size_t cnt;
17 /* Now define the internal interfaces. */
18 extern DIR *__opendir (const char *__name);
19 extern DIR *__opendirat (int dfd, const char *__name) internal_function;
20 extern DIR *__fdopendir (int __fd);
21 extern int __closedir (DIR *__dirp);
22 extern struct dirent *__readdir (DIR *__dirp);
23 extern struct dirent64 *__readdir64 (DIR *__dirp);
24 extern int __readdir_r (DIR *__dirp, struct dirent *__entry,
25 struct dirent **__result);
26 extern int __readdir64_r (DIR *__dirp, struct dirent64 *__entry,
27 struct dirent64 **__result);
28 extern int __scandir64 (const char * __dir,
29 struct dirent64 *** __namelist,
30 int (*__selector) (const struct dirent64 *),
31 int (*__cmp) (const struct dirent64 **,
32 const struct dirent64 **));
33 extern __ssize_t __getdents (int __fd, char *__buf, size_t __nbytes)
34 internal_function;
35 extern __ssize_t __getdents64 (int __fd, char *__buf, size_t __nbytes)
36 internal_function;
37 extern int __alphasort64 (const struct dirent64 **a, const struct dirent64 **b)
38 __attribute_pure__;
39 extern int __versionsort64 (const struct dirent64 **a,
40 const struct dirent64 **b)
41 __attribute_pure__;
42 extern DIR *__alloc_dir (int fd, bool close_fd, int flags,
43 const struct stat64 *statp)
44 internal_function;
45 extern void __scandir_cancel_handler (void *arg);
47 libc_hidden_proto (rewinddir)
48 libc_hidden_proto (scandirat)
49 libc_hidden_proto (scandirat64)
50 # endif
52 #endif