code wiki / _hdl_build / nx_mkdirp.nx

nx_mkdirp.nx

buildroot/runtime/_hdl_build/nx_mkdirp.nx

5094 B112 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_mkdirp.nx -- the missing sovereign mkdir-p MCP primitive: create a directory PATH (with parents). The ecosystem had NO exposed mkdir verb (nx_fs_write cannot create parent dirs) -> knowledge/fetched/ never existed -> the ~119 *_research_fetch organs ALL SAVE-FAIL'd (seq191). This fills that gap. GUARDED BY CONSTRUCTION (rule 12/26): path MUST start knowledge/ | sites/ | /tmp/ , NO '..' -> writes confined to safe roots, never OS/system dirs. Idempotent (mkdirat EEXIST ignored). Pattern = the proven __syscall(258=mkdirat, AT_FDCWD=-100, path, 0755) used across nx_manga_get_gate / nx_evidence_gather. nx_mkdirp <relpath> -> creates each path component; prints MKDIRP OK <path> license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_mkdirp.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main mp_werr sys_write mp_slen sys_exit mp_has_dotdot mp_prefix_ok mp_starts sys_mmap mp_mkdir_one sys_mmap ↻ sys_munmap mp_exists sys_openat_rd sys_close sys_write ↻ mp_puts sys_write ↻ mp_slen ↻

structs

none

consts

10const MP_MAGIC_1024: i64 = 1024
12const MP_OUT: i64 = 1
13const MP_ERR: i64 = 2

functions

15func mp_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: mp_putsmp_werr
16func mp_puts(s: *u8) -> i64 { sys_write(MP_OUT, s, mp_slen(s)); return 0 }
called by 1: main calls 2: sys_writemp_slen
17func mp_werr(s: *u8) -> i64 { sys_write(MP_ERR, s, mp_slen(s)); return 0 }
called by 1: main calls 2: sys_writemp_slen
18func mp_starts(p: *u8, pre: *u8) -> i64
called by 1: mp_prefix_ok
26func mp_has_dotdot(p: *u8) -> i64
called by 1: main
34func mp_prefix_ok(p: *u8) -> i64
called by 1: main calls 1: mp_starts
43func mp_mkdir_one(path: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_munmap
51func mp_exists(path: *u8) -> i64
called by 1: main calls 2: sys_openat_rdsys_close
58func main(argc: i64, argv: *i64) -> i64