Skip to main content

stdin_is_a_pipe

Function stdin_is_a_pipe 

Source
pub fn stdin_is_a_pipe() -> bool
Expand description

Is stdin a pipe or a socket, as when a parent process spawned us and holds the other end? Asked of descriptor 0 itself (fstat), never of the path /dev/stdin: the path resolves through /dev/fd, which some harnesses (a coverage runner, a sandbox) do not expose, and a wrong “no” here sends serve into the run-forever branch while its parent waits for it to end.