The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
Loading...
Searching...
No Matches
dirent.h
Go to the documentation of this file.
1
#pragma once
2
3
/**
4
* the directory records getdents writes. the layout and the DT_ values are
5
* ABI: the libc's <dirent.h> reads the same ones.
6
*
7
* records follow each other in the buffer; d_reclen is the size of one
8
* record, its name and NUL included, rounded up to 4 bytes.
9
*/
10
11
#include "
common/stdint.h
"
12
13
// d_type values
14
#define DT_UNKNOWN 0
15
#define DT_FIFO 1
16
#define DT_CHR 2
17
#define DT_DIR 4
18
#define DT_BLK 6
19
#define DT_REG 8
20
#define DT_LNK 10
21
#define DT_SOCK 12
22
23
struct
kdirent
24
{
25
uint32_t
d_ino
;
// inode number
26
uint16_t
d_reclen
;
// bytes to the next record
27
uint8_t
d_type
;
// DT_*
28
char
d_name
[];
// NUL-terminated
29
}
__attribute__
((packed));
30
31
// bytes before d_name
32
#define KDIRENT_HEADER 7
stdint.h
uint32_t
unsigned int uint32_t
Definition
fb.h:17
uint8_t
unsigned char uint8_t
Definition
fb.h:18
uint16_t
unsigned short uint16_t
Definition
stdint.h:13
__attribute__
ELF32 file header.
Definition
elf.h:51
kdirent
Definition
dirent.h:24
kdirent::d_ino
uint32_t d_ino
Definition
dirent.h:25
kdirent::d_name
char d_name[]
Definition
dirent.h:28
kdirent::d_reclen
uint16_t d_reclen
Definition
dirent.h:26
kdirent::d_type
uint8_t d_type
Definition
dirent.h:27
src
kernel
vfs
dirent.h
Generated by
1.18.0