use alt signal stack when present for implementation-internal signals
[musl.git] / include / dirent.h
blob650ecf646ad71c6baf127e328e66ec199ad99ee2
1 #ifndef _DIRENT_H
2 #define _DIRENT_H
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
8 #include <features.h>
10 #define __NEED_ino_t
11 #define __NEED_off_t
12 #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
13 #define __NEED_size_t
14 #endif
16 #include <bits/alltypes.h>
18 #include <bits/dirent.h>
20 typedef struct __dirstream DIR;
22 #define d_fileno d_ino
24 int closedir(DIR *);
25 DIR *fdopendir(int);
26 DIR *opendir(const char *);
27 struct dirent *readdir(DIR *);
28 int readdir_r(DIR *__restrict, struct dirent *__restrict, struct dirent **__restrict);
29 void rewinddir(DIR *);
30 int dirfd(DIR *);
32 int alphasort(const struct dirent **, const struct dirent **);
33 int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **));
35 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
36 void seekdir(DIR *, long);
37 long telldir(DIR *);
38 #endif
40 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
41 #define DT_UNKNOWN 0
42 #define DT_FIFO 1
43 #define DT_CHR 2
44 #define DT_DIR 4
45 #define DT_BLK 6
46 #define DT_REG 8
47 #define DT_LNK 10
48 #define DT_SOCK 12
49 #define DT_WHT 14
50 #define IFTODT(x) ((x)>>12 & 017)
51 #define DTTOIF(x) ((x)<<12)
52 int getdents(int, struct dirent *, size_t);
53 #endif
55 #ifdef _GNU_SOURCE
56 int versionsort(const struct dirent **, const struct dirent **);
57 #endif
59 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
60 #define dirent64 dirent
61 #define readdir64 readdir
62 #define readdir64_r readdir_r
63 #define scandir64 scandir
64 #define alphasort64 alphasort
65 #define versionsort64 versionsort
66 #define off64_t off_t
67 #define ino64_t ino_t
68 #define getdents64 getdents
69 #endif
71 #ifdef __cplusplus
73 #endif
75 #endif