code wiki / (root) / nx_dirent.nx

nx_dirent.nx

buildroot/runtime/nx_dirent.nx

4559 B149 linesdepth 4pulls 4 transitivereach 62 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_dirent.nx -- getdents64(2) directory iteration. Used by: - Build tools that walk source directories (find *.nx files) - Test harnesses that enumerate test cases - File-based config loaders - Sovereign `ls` (companion to objdump / readelf / nm) Linux RV64 syscall: 61 (getdents64). Returns a buffer of variable-sized struct linux_dirent64 records: ino_t d_ino u64 off_t d_off u64 ushort d_reclen u16 (size of THIS record) uchar d_type u8 char d_name[] NUL-terminated, padded to alignment Total per record = d_reclen. Caller scans by adding d_reclen.

dependencies 2 imports · 18 importers

syscalls.nx nx_fcntl.nx nx_dirent.nx _si_walk_probe.nx nx_bundle_gen.nx nx_dedup_audit.nx nx_dir.nx nx_game_synth.nx nx_gate_baseline_sweep.nx nx_gate_mutation_sweep.nx nx_gateemit_gate.nx nx_library_harvest_v2.nx nx_pub_audit_run.nx

diagram shows first 10 each side; +0 more imports, +8 more importers in the complete lists below.

imports: syscalls.nxnx_fcntl.nx

imported by: _si_walk_probe.nxnx_bundle_gen.nxnx_dedup_audit.nxnx_dir.nxnx_game_synth.nxnx_gate_baseline_sweep.nxnx_gate_mutation_sweep.nxnx_gateemit_gate.nxnx_library_harvest_v2.nxnx_pub_audit_run.nxnx_research_grow.nxnx_sensor_gap_census.nxnx_sovereign_format_census.nxnx_substrate_diagram.nxnx_substrate_diagram_ascii.nxnx_substrate_evolve.nxnx_template_instantiate.nxnx_wall_scan_native.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_openat nx_dirent_read nx_dirent_iter

structs

49struct NxDirent

consts

27const NX_MAGIC_8192: i64 = 8192
33const NX_SYS_GETDENTS64: i64 = 217
36const NX_SYS_GETDENTS64: i64 = 61
40const NX_DT_UNKNOWN: i64 = 0
41const NX_DT_FIFO: i64 = 1
42const NX_DT_CHR: i64 = 2
43const NX_DT_DIR: i64 = 4
44const NX_DT_BLK: i64 = 6
45const NX_DT_REG: i64 = 8
46const NX_DT_LNK: i64 = 10
47const NX_DT_SOCK: i64 = 12
57const NX_DIRENT_BYTES: i64 = 40

functions

62func nx_dirent_read(fd: i64, buf: *u8, cap: i64) -> i64
73func nx_dirent_iter(buf: *u8, off: i64, end: i64, out: *NxDirent) -> i64
100func nx_dirent_name_len(d: *NxDirent) -> i64
108func main() -> i64