Lines Matching defs:fd
182 int fd; /* hook FD, -1 if not applicable */
570 static inline int dup_good_fd(int fd)
572 if (fd < 0)
573 return fd;
574 return fcntl(fd, F_DUPFD_CLOEXEC, 3);
577 /* if fd is stdin, stdout, or stderr, dup to a fd greater than 2
578 * Takes ownership of the fd passed in, and closes it if calling
579 * fcntl(fd, F_DUPFD_CLOEXEC, 3).
581 static inline int ensure_good_fd(int fd)
583 int old_fd = fd, saved_errno;
585 if (fd < 0)
586 return fd;
587 if (fd < 3) {
588 fd = dup_good_fd(fd);
592 if (fd < 0) {
597 return fd;
655 int fd;
667 int probe_fd(int fd);