pub fn dup(fd: usize) -> Result<usize, Error>
Duplicate a file descriptor (POSIX dup). Returns the new fd.