Lines Matching refs:ttyfd
51 pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) in pty_allocate() argument
58 i = openpty(ptyfd, ttyfd, NULL, NULL, NULL); in pty_allocate()
63 name = ttyname(*ttyfd); in pty_allocate()
84 *ttyfd = open(namebuf, O_RDWR | O_NOCTTY); in pty_allocate()
85 if (*ttyfd < 0) { in pty_allocate()
123 *ttyfd = open(namebuf, O_RDWR | O_NOCTTY); in pty_allocate()
124 if (*ttyfd < 0) { in pty_allocate()
134 if (ioctl(*ttyfd, I_PUSH, "ptem") < 0) in pty_allocate()
136 if (ioctl(*ttyfd, I_PUSH, "ldterm") < 0) in pty_allocate()
139 if (ioctl(*ttyfd, I_PUSH, "ttcompat") < 0) in pty_allocate()
158 *ttyfd = open(name, O_RDWR | O_NOCTTY); in pty_allocate()
159 if (*ttyfd < 0) { in pty_allocate()
187 *ttyfd = open(namebuf, O_RDWR|O_NOCTTY); in pty_allocate()
188 if (*ttyfd < 0) { in pty_allocate()
223 *ttyfd = open(namebuf, O_RDWR | O_NOCTTY); in pty_allocate()
224 if (*ttyfd < 0) { in pty_allocate()
266 pty_make_controlling_tty(int *ttyfd, const char *ttyname) in pty_make_controlling_tty() argument
289 ioctl(*ttyfd, TCSETCTTY, NULL); in pty_make_controlling_tty()
293 close(*ttyfd); in pty_make_controlling_tty()
294 *ttyfd = fd; in pty_make_controlling_tty()
320 if (ioctl(*ttyfd, TIOCSCTTY, NULL) < 0) in pty_make_controlling_tty()
337 close(*ttyfd); in pty_make_controlling_tty()
338 *ttyfd = fd; in pty_make_controlling_tty()