nx_pipe.nx
buildroot/runtime/nx_pipe.nx
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
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
structs
| none |
consts
| 31 | const NX_SYS_PIPE2: i64 = 59 |
functions
| 35 | func nx_pipe(fds: *i32, flags: i64) -> i64 |
| 40 | func nx_pipe_cloexec(fds: *i32) -> i64 calls 1: nx_pipe |
| 46 | func main() -> i64 |