code wiki / (root) / nx_proc.nx

nx_proc.nx

buildroot/runtime/nx_proc.nx

5123 B149 linesdepth 3pulls 3 transitivereach 214 importersview sourcekind tooltopic proc
docsdependenciesstructsconstsfunctions

about

nx_proc.nx -- process management syscalls (fork / execve / wait4 / clone). Used by: - Test harnesses that fork off child workers - Build tools that exec compilers / linkers / assemblers - Sandboxes that spawn restricted subprocesses - Watchdogs that fork supervisors All syscalls go through __syscall. We accept i64 for argv / envp pointer arrays since NishiLang doesn't have *char ** in the type system today. Exit-status macros: nx_proc_wait_exited / nx_proc_wait_status / nx_proc_wait_signaled mirror the WIFEXITED / WEXITSTATUS / WIFSIGNALED glibc macros for inspecting wait4's status word.

dependencies 1 imports · 3 importers

syscalls.nx nx_proc.nx nx_probe_pid.nx nx_proc_kat.nx nx_thread.nx

imports: syscalls.nx

imported by: nx_probe_pid.nxnx_proc_kat.nxnx_thread.nx

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

main nx_proc_wait_exited nx_proc_wait_status nx_proc_wait_signaled nx_proc_wait_termsig nx_proc_getpid

structs

none

consts

26const NX_SYS_CLONE: i64 = 220
27const NX_SYS_EXECVE: i64 = 221
28const NX_SYS_EXIT: i64 = 93
29const NX_SYS_EXIT_GRP: i64 = 94
30const NX_SYS_WAIT4: i64 = 260
31const NX_SYS_GETPID: i64 = 172
32const NX_SYS_GETPPID: i64 = 173
35const NX_CLONE_VM: i64 = 0x100
36const NX_CLONE_FS: i64 = 0x200
37const NX_CLONE_FILES: i64 = 0x400
38const NX_CLONE_SIGHAND: i64 = 0x800
39const NX_CLONE_THREAD: i64 = 0x10000
48const NX_SIGCHLD_NUM: i64 = 17

functions

50func nx_proc_fork() -> i64
called by 1: main
61func nx_proc_execve(path: *u8, argv: i64, envp: i64) -> i64
79func nx_proc_wait4(pid: i64, status: *i64, options: i64) -> i64
84func nx_proc_wait_any(status: *i64) -> i64
calls 1: nx_proc_wait4
89func nx_proc_wait_exited(status: i64) -> i64
called by 2: mainmain
95func nx_proc_wait_status(status: i64) -> i64
called by 2: mainmain
100func nx_proc_wait_signaled(status: i64) -> i64
called by 2: mainmain
108func nx_proc_wait_termsig(status: i64) -> i64
called by 2: mainmain
113func nx_proc_getpid() -> i64
called by 4: mainmainmainmain
117func nx_proc_getppid() -> i64
called by 1: main
123func main() -> i64