dup2.c 198 B

123456789101112
  1. #include <unistd.h>
  2. #include <syscall.h>
  3. DEFN_SYSCALL2(dup2, 22, int, int);
  4. int dup2(int oldfd, int newfd) {
  5. return syscall_dup2(oldfd, newfd);
  6. }
  7. int dup(int oldfd) {
  8. return dup2(oldfd, -1);
  9. }