code wiki / _hdl_build / nx_hang.nx

nx_hang.nx source

↩ module page · 15 lines · 485 B

1// nx_hang.nx -- a deliberately-runaway organ (sleeps forever) to prove nx_jobserver's WATCHDOG actually 2// kills a hung job instead of letting it stall the queue / eat memory. Used only as a negative-control child. 3// license_tier: ORIGINAL 4import "nx_syscalls.nx" 5 6func main() -> i64 { 7 var x: i64 = 1 8 while x == 1 { 9 let ts: *i64 = sys_mmap(16) as *i64 10 ts[0] = 1 11 ts[1] = 0 12 __syscall(SYS_CLOCK_NANOSLEEP, 0, 0, ts, 0, 0, 0) 13 } 14 return 0 15}