Read a file always using mmap, with MADV_HUGEPAGE + WILLNEED.
Used by tac for large files (>= 16MB) that benefit from zero-copy
vmsplice output and parallel scanning. Callers should use read_file_vec()
for smaller files to avoid mmap page fault overhead.
Read a file entirely into a mutable Vec.
Uses exact-size allocation from fstat + single read() for efficiency.
Preferred over mmap when the caller needs mutable access (e.g., in-place decode).
Read all bytes from stdin into a Vec.
On Linux, uses raw libc::read() to bypass Rust’s StdinLock/BufReader overhead.
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).
Callers should enlarge the pipe buffer via fcntl(F_SETPIPE_SZ) before calling.
Uses the full spare capacity for each read() to minimize syscalls.
Splice piped stdin to a memfd, then mmap for zero-copy access.
Uses splice(2) to move data from the stdin pipe directly into a memfd’s
page cache (kernel→kernel, no userspace copy). Returns a mutable mmap.
Returns None if stdin is not a pipe or splice fails.