Lines Matching refs:ttyfd
3927 int ttyfd = -1;
4024 ttyfd = open("/dev/tty", O_RDWR);
4029 ttyfd = -1;
4053 if (ttyfd < 0) {
4092 if (ioctl(ttyfd, TIOCGLTC, <c) == -1)
4096 if (ioctl(ttyfd, TIOCLGET, &lmode) == -1)
4100 rc = ttyGetAttr(ttyfd, &tio);
4104 rc = ioctl(ttyfd, TIOCGETP, (char *) &sg);
4107 if (ioctl(ttyfd, TIOCGETC, (char *) &tc) == -1)
4109 if (ioctl(ttyfd, TIOCGETD, (char *) &discipline) == -1)
4112 if (ioctl(ttyfd, TIOCKGET, (char *) &jmode) == -1)
4114 if (ioctl(ttyfd, TIOCKGETC, (char *) &jtc) == -1)
4137 close_fd(ttyfd);
4364 ttyfd = ptyfd;
4431 if (ttyfd >= 0) {
4432 close_fd(ttyfd);
4438 && (ttyfd = open("/dev/tty", O_RDWR)) >= 0) {
4439 ioctl(ttyfd, TIOCNOTTY, (char *) NULL);
4440 close_fd(ttyfd);
4446 if ((ttyfd = open(ttydev, O_RDWR)) >= 0) {
4447 TRACE_GET_TTYSIZE(ttyfd, "after open");
4448 TRACE_RC(i, SET_TTYSIZE(ttyfd, ts));
4449 TRACE_GET_TTYSIZE(ttyfd, "after SET_TTYSIZE fixup");
4452 ioctl(ttyfd, TCSETCTTY, 0);
4456 ioctl(ttyfd, TIOCSCTTY, 0);
4475 ioctl(ttyfd, TIOCSCTTY, 0);
4500 if (ttyfd >= 0)
4501 close(ttyfd);
4510 if ((ptr = ttyname(ttyfd)) != NULL) {
4533 if (ttyGetAttr(ttyfd, &tio) == -1)
4632 if (ioctl(ttyfd, TIOCSLTC, <c) == -1)
4636 if (ioctl(ttyfd, TIOCLSET, (char *) &lmode) == -1)
4639 if (ttySetAttr(ttyfd, &tio) == -1)
4648 (void) ttySetAttr(ttyfd, &tio);
4695 if (ioctl(ttyfd, TIOCSETP, (char *) &sg) == -1)
4697 if (ioctl(ttyfd, TIOCSETC, (char *) &tc) == -1)
4699 if (ioctl(ttyfd, TIOCSETD, (char *) &discipline) == -1)
4701 if (ioctl(ttyfd, TIOCSLTC, (char *) <c) == -1)
4703 if (ioctl(ttyfd, TIOCLSET, (char *) &lmode) == -1)
4706 if (ioctl(ttyfd, TIOCKSET, (char *) &jmode) == -1)
4708 if (ioctl(ttyfd, TIOCKSETC, (char *) &jtc) == -1)
4716 if (ioctl(ttyfd, TIOCCONS, (char *) &on) == -1)
4721 if (fd == -1 || ioctl(fd, SRIOCSREDIR, ttyfd) == -1)
4758 if (ttyGetAttr(ttyfd, &tio) == -1)
4764 TRACE_RC(rc, ttySetAttr(ttyfd, &tio));
4766 if (ioctl(ttyfd, TIOCGETP, (char *) &sg) == -1)
4772 rc = ioctl(ttyfd, TIOCSETP, (char *) &sg);
4814 close_fd(ttyfd);
4828 if (i != ttyfd) {
4830 IGNORE_RC(dup(ttyfd));
4834 if (ttyfd > 2)
4835 close_fd(ttyfd);