code wiki / _hdl_build / nx_wd_toy_green.nx
nx_wd_toy_green.nx source
↩ module page · 18 lines · 667 B
1// nx_wd_toy_green.nx -- gate fixture for the work dispatcher: a WELL-BEHAVED
2// EXEC recipe. Appends its green marker and exits 0; the dispatcher gate's
3// scratch row points its MARK at the LAST WDTOYGREEN line (last-line-wins
4// makes re-runs safe). Not a mock: it runs through the real sovereign lane.
5// license_tier: ORIGINAL
6import "nx_syscalls.nx"
7
8func main() -> i64 {
9 let fd: i64 = sys_openat_append("/tmp/_wd_toy.log" as *u8, 0x1a4)
10 if fd < 0 { sys_exit(3) }
11 let s: *u8 = "WDTOYGREEN verdict=GREEN\n" as *u8
12 var n: i64 = 0
13 while s[n] != (0 as u8) { n = n + 1 }
14 sys_write(fd, s, n)
15 sys_close(fd)
16 sys_exit(0)
17 return 0
18}