1 2 3 4 5 6 7 8 9 10 11
#include <unistd.h> #include <sys/syscall.h> #ifndef __NR_dup2 int dup2(int fd, int fd2) { return dup3(fd, fd2, 0); } #endif /* __NR_dup2 */