Skip to main content

write_line_to_real_stderr

Function write_line_to_real_stderr 

Source
pub fn write_line_to_real_stderr(line: &str)
Expand description

Write line plus a newline to the parent’s real stderr. Used by the recursive-run output multiplexer, which pipes child stderr through aube and re-emits each line with a <package>: prefix — eprintln! writes to fd 2, which SilentStderrGuard has redirected to /dev/null under --silent, so child stderr would otherwise be silently swallowed in --silent --parallel mode. Routes through the saved real-stderr fd when silent mode is active, fd 2 otherwise.

write_all of a pre-built <line>\n buffer issues a single short write to the kernel; on TTYs and pipes the kernel’s PIPE_BUF (= 4096+ on every supported unix) atomicity keeps lines from concurrent pump tasks intact without explicit locking. The dup happens per line so we don’t share a long-lived File handle that would need its own lock — a duplicate write syscall pair is cheaper than an Arc<Mutex<File>> and correct under concurrency.