code wiki / _hdl_build / nx_autorun_daemon.nx

nx_autorun_daemon.nx

buildroot/runtime/_hdl_build/nx_autorun_daemon.nx

8710 B173 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind service
docsdependenciesstructsconstsfunctions

about

nx_autorun_daemon.nx -- THE SLOW BEAT (was: math-only; X-Q-007 made the target list DATA): each beat re-proves every conf-listed target through the durable lane. Kept OFF the 30-min Conductor pulse on purpose (rule 21: the pulse stays cheap and reads evidence; THIS daemon renews it). - interval from knowledge/status/autorun_daemon.conf (I row) - targets from the SAME conf (T <basename> rows, re-read EVERY beat so conf edits apply without re-arm; no T rows = the historical nx_math_rung_run default) -- policy in nx_ad_core (gate-driven) - beat output -> autorun_daemon.out; AUTORUN-TGT row per target + ONE AUTORUN-BEAT row (rung_rc= kept as worst-rc for old readers) - self-daemonizes; duplicate guard via autorun_daemon.pid + /proc cmdline Sovereign (syscalls only, no .sh). Run from nxc2 root. license_tier: ORIGINAL (nx_syscalls arrives via nx_ad_core -- a direct second import alongside it produced a deterministic NXASM rc=6 on this file; dedup fixed it)

dependencies 1 imports · 0 importers

nx_ad_core.nx nx_autorun_daemon.nx

imports: nx_ad_core.nx

imported by: nobody (leaf or entry point)

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

main ad_fifo_path ad_read_all sys_read ad_cat ad_acquire_lock ad_already_running ad_read_all ↻ ad_cat ↻ ad_contains ad_len _p sys_fork _pn sys_openat_wr _fn nx_setsid ad_open_event sys_read ↻ ad_beat adc_beat sys_mmap adc_targets sys_mmap ↻ adc_read sys_openat_rd sys_read ↻ sys_close sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sys_openat_append adc_run_one sys_fork ↻ sys_mmap ↻ sys_openat_append ↻ sys_dup3 sys_execve sys_exit sys_wait4

structs

none

consts

16const SYS_MAGIC_4096: i64 = 4096
17const SYS_MAGIC_4080: i64 = 4080
96const SYS_MKNODAT: i64 = 259 // x86-64 (the daemon runs on the WSL x86-64 host)
97const S_IFIFO_0666: i64 = 4534 // S_IFIFO (0o010000=4096) | 0o666 (438)
98const O_RDWR_FLAG: i64 = 2 // open the FIFO read+write so the daemon is always

functions

18func _p(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
19func _pn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=48+(m%10);m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 }
called by 1: main
20func _fp(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
21func _fn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=48+(m%10);m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 }
called by 1: main
22func ad_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: ad_contains
23func ad_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i }
24func ad_read_all(path: *u8, buf: *u8, cap: i64) -> i64
33func ad_contains(hay: *u8, n: i64, pat: *u8) -> i64
called by 1: ad_already_running calls 1: ad_len
46func ad_sleep(secs: i64) -> i64
52func ad_interval() -> i64
calls 1: ad_read_all
76func ad_already_running() -> i64
called by 1: main calls 3: ad_read_allad_catad_contains
102func ad_fifo_path(out: *u8) -> i64
called by 1: main calls 2: ad_read_allad_cat
124func ad_open_event(path: *u8) -> i64
called by 1: main
129func ad_beat() -> i64
called by 1: main calls 1: adc_beat
134func main() -> i64