code wiki / (root) / nx_pipe.nx

nx_pipe.nx

buildroot/runtime/nx_pipe.nx

2218 B70 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_pipe.nx -- pipe(2) + pipe2(2) wrappers. Pipes are how forked processes communicate: parent fork()s, child write to pipe[1], parent reads from pipe[0]. The build tool pattern is: pipe(fds) # fds[0]=read end, fds[1]=write end pid = fork() if pid == 0: # child close(fds[0]) dup3(fds[1], 1, 0) # redirect stdout execve(...) else: # parent close(fds[1]) n = read(fds[0], buf, ...) Linux RV64 has no sys_pipe -- we use sys_pipe2 (number 59) with flags=0. Optionally O_CLOEXEC to avoid leaking ends across exec. Pairs with nx_fcntl + nx_proc.

dependencies 2 imports · 0 importers

syscalls.nx nx_fcntl.nx nx_pipe.nx

imports: syscalls.nxnx_fcntl.nx

imported by: nobody (leaf or entry point)

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

main nx_pipe sys_read

structs

none

consts

31const NX_SYS_PIPE2: i64 = 59

functions

35func nx_pipe(fds: *i32, flags: i64) -> i64
called by 2: nx_pipe_cloexecmain
40func nx_pipe_cloexec(fds: *i32) -> i64
calls 1: nx_pipe
46func main() -> i64
calls 2: nx_pipesys_read