Lines Matching refs:fd
44 ms_windows_dup2 (int fd, int desired_fd) in ms_windows_dup2() argument
51 if (fd == desired_fd) in ms_windows_dup2()
53 if ((HANDLE) _get_osfhandle (fd) == INVALID_HANDLE_VALUE) in ms_windows_dup2()
58 return fd; in ms_windows_dup2()
71 result = dup2 (fd, desired_fd); in ms_windows_dup2()
91 rpl_dup2 (int fd, int desired_fd) in rpl_dup2() argument
99 if (fd == desired_fd) in rpl_dup2()
100 return fcntl (fd, F_GETFL) == -1 ? -1 : fd; in rpl_dup2()
103 result = dup2 (fd, desired_fd); in rpl_dup2()
109 if (fd != desired_fd && result != -1) in rpl_dup2()
110 result = _gl_register_dup (fd, result); in rpl_dup2()
121 dupfd (int fd, int desired_fd) in dupfd() argument
123 int duplicated_fd = dup (fd); in dupfd()
128 int r = dupfd (fd, desired_fd); in dupfd()
138 dup2 (int fd, int desired_fd) in dup2() argument
140 int result = fcntl (fd, F_GETFL) < 0 ? -1 : fd; in dup2()
141 if (result == -1 || fd == desired_fd) in dup2()
145 result = fcntl (fd, F_DUPFD, desired_fd); in dup2()
148 result = _gl_register_dup (fd, result); in dup2()
151 result = dupfd (fd, desired_fd); in dup2()