#[repr(C)]pub struct Dirent64 {
pub ino: u64,
pub off: i64,
pub reclen: u16,
pub ftype: u8,
pub name: [u8; 0],
}
Expand description
表示目录项(dirent)的结构体,用于读取目录内容(如 getdents64)
Fields§
§ino: u64
inode 号(索引节点号),唯一标识文件
off: i64
偏移量,指向下一个目录项在目录流中的位置(用于遍历)
reclen: u16
当前目录项结构体的长度(包括文件名),单位是字节
ftype: u8
文件类型(如常规文件、目录、符号链接等)
name: [u8; 0]
文件名(不定长,以空字符结尾,声明为 0 长度数组便于动态追加)