pub fn getproc(cmd: &str, eptr: Option<&mut usize>) -> Option<String>Expand description
Port of getproc() from Src/exec.c:5025 — C decl getproc(char *cmd, char **eptr).
<(cmd) / >(cmd) process substitution
via /dev/fd/N (PATH_DEV_FD branch; modern Linux/macOS).
(a) PATH_DEV_FD branch only — the FIFO fallback (!PATH_DEV_FD
path c:5037-5064) is omitted; modern Linux/macOS both
provide /dev/fd. namedpipe() is ported (exec.rs:2701) but
unused here.
(b) addproc is 7-arg; procsubst pid recorded via aux=true on
the current job (c:5141-5142).
(c) addfilelist(NULL, fd) wired via JOBTAB[thisjob] at
c:5087.
(d) entersubsh is ported at exec.rs:4329 — wired below at
c:5095 (entersubsh(ESUB_ASYNC|ESUB_PGRP, NULL)) in the real
forked child.
(e) execode is ported at exec.rs:6047. Body still re-feeds
through fusevm for cache coherence.
(f) The child ends with _realexit() (c:5104) after flushing
Rust’s in-process stdout buffer.
(g) fdtable[fd] = FDT_PROC_SUBST (c:5086) — set via fdtable_set.