blob: bb5e52c7a5abd5ae8db4741494d184ac8d72a5c3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
/*
* sys/dirent.h
*/
#ifndef DIRENT_H
#define DIRENT_H
#include <stdint.h>
#include <sys/types.h>
#ifndef NAME_MAX
#define NAME_MAX 255
#endif
struct dirent {
uint32_t d_ino;
uint32_t d_off;
uint16_t d_reclen;
uint16_t d_type;
char d_name[NAME_MAX + 1];
};
enum dirent_type {
DT_UNKNOWN = 0,
DT_FIFO = 1,
DT_CHR = 2,
DT_DIR = 4,
DT_BLK = 6,
DT_REG = 8,
DT_LNK = 10,
DT_SOCK = 12,
DT_WHT = 14,
};
/*
* Convert between stat structure mode types and directory types.
* The stat structure mode types are the same as in Linux.
*/
#define IFTODT(mode) (((mode) & 0170000) >> 12)
#define DTTOIF(dt) ((dt) << 12)
struct _DIR_;
typedef struct _DIR_ DIR;
#endif /* sys/dirent.h */
|