pub fn checked_dup(fd: RawFd) -> Result<OwnedFd>
dup(2) that returns an OwnedFd or an error (instead of silently returning -1).
dup(2)
OwnedFd