code wiki / _hdl_build / nx_log_append.nx

nx_log_append.nx

buildroot/runtime/_hdl_build/nx_log_append.nx

2360 B53 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic log
docsdependenciesstructsconstsfunctions

about

nx_log_append.nx -- TEAM-OWNED durable-log appender: appends the whole content of <src> to <dst> via one O_APPEND write (atomic for the pipe-buffer sizes our log rows have), in pure NishiLang. Born 2026-06-10: pm_plan_durable.log is appended by CONCURRENT sessions; editor-style read-modify-write races, shell heredocs mangle through PS/Git-Bash->wsl quoting, and the no-sh law holds -- so the append becomes a syscall-layer organ instead. Usage: nx_log_append.elf <src> <dst> Exit: 0 = appended (prints byte count), 1 = src unreadable/empty, 2 = dst unwritable, 3 = usage. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_log_append.nx

imports: nx_syscalls.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

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

main la_puts sys_write sys_openat_rd sys_mmap sys_read sys_close sys_openat_append sys_write ↻ sys_fsync la_putn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap

structs

none

consts

23const LA_MAX: i64 = 1048576

functions

16func la_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
21func la_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
25func main(argc: i64, argv: *i64) -> i64