projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9fe28f7
)
add macros for use with d_type extension field in dirent
author
Rich Felker
<dalias@aerifal.cx>
Mon, 7 Mar 2011 23:32:36 +0000
(18:32 -0500)
committer
Rich Felker
<dalias@aerifal.cx>
Mon, 7 Mar 2011 23:32:36 +0000
(18:32 -0500)
include/dirent.h
patch
|
blob
|
history
diff --git
a/include/dirent.h
b/include/dirent.h
index
a917093
..
a980629
100644
(file)
--- a/
include/dirent.h
+++ b/
include/dirent.h
@@
-34,6
+34,20
@@
int dirfd(DIR *);
int alphasort(const struct dirent **, const struct dirent **);
int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **));
int alphasort(const struct dirent **, const struct dirent **);
int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **));
+#ifdef _GNU_SOURCE
+#define DT_UNKNOWN 0
+#define DT_FIFO 1
+#define DT_CHR 2
+#define DT_DIR 4
+#define DT_BLK 6
+#define DT_REG 8
+#define DT_LNK 10
+#define DT_SOCK 12
+#define DT_WHT 14
+#define IFTODT(x) ((x)>>12 & 017)
+#define DTTOIF(x) ((x)<<12)
+#endf
+
#ifdef __cplusplus
extern }
#endif
#ifdef __cplusplus
extern }
#endif