nx_dirent.nx
buildroot/runtime/nx_dirent.nx
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
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
structs
| 49 | struct NxDirent |
consts
| 27 | const NX_MAGIC_8192: i64 = 8192 |
| 33 | const NX_SYS_GETDENTS64: i64 = 217 |
| 36 | const NX_SYS_GETDENTS64: i64 = 61 |
| 40 | const NX_DT_UNKNOWN: i64 = 0 |
| 41 | const NX_DT_FIFO: i64 = 1 |
| 42 | const NX_DT_CHR: i64 = 2 |
| 43 | const NX_DT_DIR: i64 = 4 |
| 44 | const NX_DT_BLK: i64 = 6 |
| 45 | const NX_DT_REG: i64 = 8 |
| 46 | const NX_DT_LNK: i64 = 10 |
| 47 | const NX_DT_SOCK: i64 = 12 |
| 57 | const NX_DIRENT_BYTES: i64 = 40 |
functions
| 62 | func nx_dirent_read(fd: i64, buf: *u8, cap: i64) -> i64 |
| 73 | func nx_dirent_iter(buf: *u8, off: i64, end: i64, out: *NxDirent) -> i64 |
| 100 | func nx_dirent_name_len(d: *NxDirent) -> i64 |
| 108 | func main() -> i64 |