nx_clock_driver_toolrun_ar.nx
buildroot/runtime/nx_clock_driver_toolrun_ar.nx
about
nx_tool_run.nx -- R0 of the EXECUTABLE-API rung: the sovereign exec+capture primitive the ecosystem
is missing. Today nishifamily.com/api/tools + /mcp only LIST tools (a read-only registry) and MCP
tools/call returns a SAFE STUB ("invoked X (capability-authorized)") -- there is NO way to actually
RUN an organ and hand back its real stdout. This organ is that missing capability, built hardware-up
from raw syscalls (fork/pipe/dup3/execve/wait4), reusing the EXACT proven wrappers from nx_hostctl's
hc_dfork_exec so it inherits the same never-brick discipline. NO /bin/sh, NO shell string, NO PATH
search -- callers pass an ABSOLUTE ELF path (the allowlist layer that maps tool-name -> path is R1,
nx_tool_registry). Synchronous (wait4), unlike hc_dfork_exec's detach -- because an API tools/call
needs the child's OUTPUT and EXIT CODE, not a fire-and-forget daemon.
license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_syscalls.nxnx_clock_driver_boundary_ar.nx
imported by: nx_clock_driver_gate_ar.nx
structs
| none |
consts
| 15 | const TR_EINTR: i64 = 0 - 4 |
| 17 | const TR_EINTR_MAX: i64 = 4096 |
| 34 | const TR_EXIT_EXECFAIL: i64 = 127 |
| 35 | const TR_MODE_0644: i64 = 420 |
| 197 | const TR_ERR_TIMEOUT: i64 = 0 - 5 |
| 198 | const TR_SIGKILL: i64 = 9 |
| 310 | const TR_PROMOTE: i64 = 0 - 7 // distinct from TR_ERR_TIMEOUT (-5) and TR_ERR_CHDIR (-6) |
| 311 | const TR_POLLFD_BYTES: i64 = 8 // sizeof(struct pollfd) |
| 312 | const TR_POLLIN: i64 = 1 // POLLIN |
| 313 | const TR_PF_EV_OFF: i64 = 4 // offsetof(struct pollfd, events) |
| 314 | const TR_PF_RE_OFF: i64 = 6 // offsetof(struct pollfd, revents) |
| 315 | const TR_PF_FD_BYTES: i64 = 4 // sizeof(i32 fd) |
| 316 | const TR_BITS_PER_BYTE: i64 = 8 |
| 317 | const TR_BYTE_MASK: i64 = 0xff |
| 413 | const TR_ERR_CHDIR: i64 = 0 - 6 |
| 507 | const TR_FIT: i64 = 0 |
| 508 | const TR_CUT: i64 = 1 |
functions
| 37 | func tr_exec_failed(path: *u8) -> i64 |
| 83 | func tr_run_redirect(path: *u8, argv: *i64, out_path: *u8, err_path: *u8) -> i64 |
| 121 | func tr_run_capture(path: *u8, argv: *i64, out: *u8, cap: i64, outlen: *i64) -> i64 |
| 202 | func tr_run_capture_to(path: *u8, argv: *i64, out: *u8, cap: i64, outlen: *i64, timeout_ms: i64) -> i64 called by 1: tr_run1_to calls 15: tr_run_capturesys_mmapsys_pipe2sys_forksys_closesys_default_signal+9 |
| 318 | func tr_pollfd_set(p: *u8, fd: i64) -> i64 called by 1: tr_run_capture_deadline |
| 330 | func tr_run_capture_deadline(path: *u8, argv: *i64, out: *u8, cap: i64, outlen: *i64, deadline_ms: i64, out_pid: *i64, out_rfd: *i64) -> i64 |
| 414 | func tr_run_capture_cwd(path: *u8, argv: *i64, out: *u8, cap: i64, outlen: *i64, timeout_ms: i64, cwd: *u8) -> i64 |
| 509 | func tr_drain_tr(rfd: i64, out: *u8, cap: i64, trunc: *i64) -> i64 |
| 539 | func tr_run_capture_tr(path: *u8, argv: *i64, out: *u8, cap: i64, outlen: *i64, timeout_ms: i64, trunc: *i64) -> i64 |
| 596 | func tr_run1(path: *u8, arg: *u8, out: *u8, cap: i64, outlen: *i64) -> i64 |
| 604 | func tr_run1_to(path: *u8, arg: *u8, out: *u8, cap: i64, outlen: *i64, timeout_ms: i64) -> i64 |
| 612 | func tr_contains(buf: *u8, n: i64, needle: *u8) -> i64 |