code wiki / (root) / nx_proc_ctl.nx

nx_proc_ctl.nx

buildroot/runtime/nx_proc_ctl.nx

13956 B263 linesdepth 2pulls 2 transitivereach 17 importersview sourcekind librarytopic proc
docsdependenciesstructsconstsfunctions

about

nx_proc_ctl.nx -- shared sovereign /proc process control: kill-by-name + alive-by-name, EXTRACTED VERBATIM from the proven nx_hostctl scanners so the Publisher's recovery executor reuses them WITHOUT importing the whole supervisor (DRY; nx_hostctl can adopt this later). Matches /proc/<pid>/cmdline. No shell, no pkill. CRITICAL (nx_hostctl lesson): BOUNDED cmdline read into a REUSED buffer, NEVER sys_read_file (4GiB-mmap/call leak -> the next fork ENOMEMs = the old F-class supervisor death). license_tier: ORIGINAL

dependencies 1 imports · 11 importers

nx_syscalls.nx nx_proc_ctl.nx nx_adopt.nx nx_ctxtop.nx nx_memvel.nx nx_mvault_walk.nx nx_orphan_reap.nx nx_orphan_reap_gate.nx nx_poolwidth_lib.nx nx_proc_kill.nx nx_pub_recover_exec.nx nx_resmon.nx

diagram shows first 10 each side; +0 more imports, +1 more importers in the complete lists below.

imports: nx_syscalls.nx

imported by: nx_adopt.nxnx_ctxtop.nxnx_memvel.nxnx_mvault_walk.nxnx_orphan_reap.nxnx_orphan_reap_gate.nxnx_poolwidth_lib.nxnx_proc_kill.nxnx_pub_recover_exec.nxnx_resmon.nxnx_servicectl.nx

structs

none

consts

7const K_MAGIC_65536: i64 = 65536
8const K_MAGIC_8192: i64 = 8192

functions

10func pc_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
11func pc_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8) { let c: u8=s[i]; if c<(48 as u8){return v} if c>(57 as u8){return v} v=v*10+((c-(48 as u8)) as i64); i=i+1 } return v }
12func pc_contains(hay: *u8, hn: i64, needle: *u8, nn: i64) -> i64
18func pc_read_cmdline(path: *u8, buf: *u8, cap: i64) -> i64
29func proc_kill_by_name(needle: *u8, sig: i64) -> i64
67func proc_kill_by_name_except(needle: *u8, sig: i64, keep: i64) -> i64
114func pc_line_protected(cl: *u8, cln: i64, deny: *u8, denyn: i64) -> i64
called by 2: mainproc_kill_protected calls 1: pc_contains
133func proc_kill_protected(needle: *u8, sig: i64, keep: i64, deny: *u8, denyn: i64, out: *i64) -> i64
179func proc_count_by_name(needle: *u8) -> i64
215func proc_alive_by_name(needle: *u8) -> i64
261func nx_pctl_kill_by_cmdline(name: *u8, sig: i64) -> i64
called by 2: mainmain calls 1: proc_kill_by_name