pub fn read_stdin() -> Result<Vec<u8>>Expand description
Read all bytes from stdin into a Vec. Uses a direct read() loop into a pre-allocated buffer instead of read_to_end(), which avoids Vec’s grow-and-probe pattern (extra read() calls and memcpy). On Linux, enlarges the pipe buffer to 4MB first for fewer read() syscalls. Uses the full spare capacity for each read() to minimize syscalls — after the pipe is enlarged to 4MB, each read() returns up to 4MB of data.