code wiki / _hdl_build / nx_log_append.nx
nx_log_append.nx
buildroot/runtime/_hdl_build/nx_log_append.nx
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
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
structs
| none |
consts
| 23 | const LA_MAX: i64 = 1048576 |
functions
| 16 | func 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 } |
| 21 | func la_putn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 25 | func main(argc: i64, argv: *i64) -> i64 |