code wiki / (root) / nx_lock_reap_gate.nx

nx_lock_reap_gate.nx

buildroot/runtime/nx_lock_reap_gate.nx

4276 B68 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_lock_reap_gate.nx -- liar-killed GATE for the sovereign lock-reaper (R-ORCH-2a). The load-bearing property is FAIL-SAFE: a lock is reaped ONLY when abandoned. Proves: stale+ unowned -> REAP (and the real unlink removes it); a live-OWNER lock is NEVER reaped even when old (the load-bearing neg-control -- never yank a lock a running process holds); a FRESH lock is never reaped; an absent lock is a no-op; owner-detection finds a real live process (self via a cmdline needle) and correctly reports absence for a bogus needle. Exit 0 only on all-PASS. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_lock_reap_core.nx nx_lock_reap_gate.nx

imports: nx_syscalls.nxnx_lock_reap_core.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real g_bool g_puts sys_write g_putn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap lr_should_reap g_write sys_openat_wr sys_write ↻ ccz_slen sys_close lr_exists sys_mmap ↻ sys_fstatat g_touch sys_mmap ↻ sys_utimensat lr_age_s ccz_mtime sys_mmap ↻ sys_fstatat ↻ sys_munmap ↻ lr_owner_alive ccz_slen ↻ lr_selfpid sys_mmap ↻ ccz_read sys_openat_rd sys_read sys_close ↻

structs

none

consts

none

functions

11func g_puts(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 2: g_boolmain calls 1: sys_write
14func g_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 2: g_boolmain calls 1: nxi_out
15func g_bool(name: *u8, got: i64, want: i64, passp: *i64) -> i64
called by 1: main calls 2: g_putsg_putn
20func g_write(path: *u8, s: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, 420); if fd < 0 { return 0 - 1 } sys_write(fd, s, ccz_slen(s)); sys_close(fd); return 0 }
21func g_touch(path: *u8, e: i64) -> i64 { let t: *i64 = sys_mmap(32) as *i64; t[0] = e; t[1] = 0; t[2] = e; t[3] = 0; return sys_utimensat(path, t) }
called by 1: main calls 2: sys_mmapsys_utimensat
23func main(argc: i64, argv: *i64) -> i64