dup (2) Linux Manual Page
dup, dup2, dup3 – duplicate a file descriptor Synopsis#include <unistd.h> int dup(int oldfd); int dup2(int oldfd, int newfd); #define _GNU_SOURCE /* See feature_test_macros(7) */ #include <fcntl.h> /* Obtain O_* constant definitions */ #include <unistd.h> int dup3(int oldfd, int newfd, int flags);DescriptionThe dup() system call creates a copy of the file descriptor oldfd, using the lowest-numbered…
