Lines Matching refs:newfd
57 Int newfd; in VG_() local
61 newfd = VG_(fcntl)(oldfd, VKI_F_DUPFD, VG_(fd_hard_limit)); in VG_()
62 if (newfd != -1) in VG_()
66 VG_(fcntl)(newfd, VKI_F_SETFD, VKI_FD_CLOEXEC); in VG_()
68 vg_assert(newfd >= VG_(fd_hard_limit)); in VG_()
69 return newfd; in VG_()
481 SysRes VG_(dup2) ( Int oldfd, Int newfd ) in VG_()
488 if (oldfd == newfd) { in VG_()
491 return VG_(mk_SysRes_Success)(newfd); in VG_()
493 return VG_(do_syscall3)(__NR_dup3, oldfd, newfd, 0); in VG_()
495 return VG_(do_syscall2)(__NR_dup2, oldfd, newfd); in VG_()
497 return VG_(do_syscall3)(__NR_fcntl, oldfd, F_DUP2FD, newfd); in VG_()