code wiki / _hdl_build / nx_fix_echo.nx

nx_fix_echo.nx source

↩ module page · 19 lines · 645 B

1// nx_fix_echo.nx -- seat-hub gate FIXTURE: print a canned file to stdout, exit 0. 2// argv: <file> [ignored...] Stands in for nx_mcp_call so the hub wrapper's fail-closed 3// body-parse is provable offline with controlled HELD/CONTENDED/garbage bodies. 4// license_tier: ORIGINAL No hw writes (Rule 26). 5import "nx_deploy_lib.nx" 6import "nx_syscalls.nx" 7 8const FE_CAP: i64 = 262144 9 10func main(argc: i64, argv: *i64) -> i64 { 11 if argc >= 2 { 12 let p: *u8 = argv[1] as *u8 13 let buf: *u8 = sys_mmap(FE_CAP) 14 let n: i64 = dp_read(p, buf, FE_CAP) 15 if n > 0 { sys_write(1, buf, n) } 16 } 17 sys_exit(0) 18 return 0 19}