Lines Matching refs:fd
137 static bool ttyecho(bool enable, int fd) in ttyecho() argument
147 tcgetattr(fd, &withecho); in ttyecho()
150 tcsetattr(fd, TCSANOW, &noecho); in ttyecho()
152 ioctl(fd, TCGETA, &withecho); in ttyecho()
155 ioctl(fd, TCSETA, &noecho); in ttyecho()
158 (void)fd; in ttyecho()
166 tcsetattr(fd, TCSAFLUSH, &withecho); in ttyecho()
168 ioctl(fd, TCSETA, &withecho); in ttyecho()
181 int fd = open("/dev/tty", O_RDONLY); in getpass_r() local
182 if(-1 == fd) in getpass_r()
183 fd = STDIN_FILENO; /* use stdin if the tty could not be used */ in getpass_r()
185 disabled = ttyecho(FALSE, fd); /* disable terminal echo */ in getpass_r()
188 nread = read(fd, password, buflen); in getpass_r()
197 (void)ttyecho(TRUE, fd); /* enable echo */ in getpass_r()
200 if(STDIN_FILENO != fd) in getpass_r()
201 close(fd); in getpass_r()