DUP(2) Linux Programmer s Manual DUP(2) NAME dup, dup2 - duplicate a file descriptor SYNOPSIS #include int dup(int oldfd); int dup2(int oldfd, int newfd); DESCRIPTION dup() and dup2() create a copy of the file descriptor oldfd.