code wiki / _attic / _offc_tier2_probe.nx

_offc_tier2_probe.nx source

↩ module page · 18 lines · 594 B

1import "syscalls.nx" 2import "nx_narr.nx" 3 4// Test program: deliberately fails sys_openat_rd on a non-existent 5// path so the substrate's narr_check_syscall_v_at primitive fires. 6// Expected: fd 2 carries the 5W+H editor's chart; fd 4 carries the 7// JSON twin; both reach the test harness for assertion. 8func main() -> i64 { 9 let len_raw: *u8 = sys_mmap(16) 10 let len: *i64 = len_raw as *i64 11 *len = 0 12 let buf: *u8 = sys_read_file("/_tier2_path_that_must_not_exist" as *u8, len) 13 if buf == (0 as *u8) { 14 narr_flush() 15 return 7 16 } 17 return 0 18}