int dup2(int oldFd, int newFd);
Duplicates the file handle oldFd such that the new file handle is newFd. If file handle newFd is already open, the existing file handle is closed. Returns the new file handle.
close, dup