Skip to main content

mpipe

Function mpipe 

Source
pub fn mpipe(pp: &mut [i32; 2]) -> i32
Expand description

Port of int mpipe(int *pp) from Src/exec.c:5160.

C body:

if (pipe(pp) < 0) {
    zerr("pipe failed: %e", errno);
    return -1;
}
pp[0] = movefd(pp[0]);
pp[1] = movefd(pp[1]);
return 0;

libc pipe(2) wrapper that pushes both ends out of the reserved- fd range via movefd. Used by getpipe / getproc / spawnpipes for process substitution and pipeline wiring.