Duplicate a file descriptor
FD_Type dup_fd (FD_Type fd)
The dup_fd function duplicates and file descriptor and returns its duplicate. If the function fails, NULL will be returned and errno set accordingly.
This function is essentually a wrapper around the POSIX dup function.