nx_proc.nx
buildroot/runtime/nx_proc.nx
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
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
structs
| none |
consts
| 26 | const NX_SYS_CLONE: i64 = 220 |
| 27 | const NX_SYS_EXECVE: i64 = 221 |
| 28 | const NX_SYS_EXIT: i64 = 93 |
| 29 | const NX_SYS_EXIT_GRP: i64 = 94 |
| 30 | const NX_SYS_WAIT4: i64 = 260 |
| 31 | const NX_SYS_GETPID: i64 = 172 |
| 32 | const NX_SYS_GETPPID: i64 = 173 |
| 35 | const NX_CLONE_VM: i64 = 0x100 |
| 36 | const NX_CLONE_FS: i64 = 0x200 |
| 37 | const NX_CLONE_FILES: i64 = 0x400 |
| 38 | const NX_CLONE_SIGHAND: i64 = 0x800 |
| 39 | const NX_CLONE_THREAD: i64 = 0x10000 |
| 48 | const NX_SIGCHLD_NUM: i64 = 17 |
functions
| 50 | func nx_proc_fork() -> i64 called by 1: main |
| 61 | func nx_proc_execve(path: *u8, argv: i64, envp: i64) -> i64 |
| 79 | func nx_proc_wait4(pid: i64, status: *i64, options: i64) -> i64 |
| 84 | func nx_proc_wait_any(status: *i64) -> i64 calls 1: nx_proc_wait4 |
| 89 | func nx_proc_wait_exited(status: i64) -> i64 |
| 95 | func nx_proc_wait_status(status: i64) -> i64 |
| 100 | func nx_proc_wait_signaled(status: i64) -> i64 |
| 108 | func nx_proc_wait_termsig(status: i64) -> i64 |
| 113 | func nx_proc_getpid() -> i64 |
| 117 | func nx_proc_getppid() -> i64 called by 1: main |
| 123 | func main() -> i64 |