Lines Matching refs:pty
76 # include <pty.h>
178 static int get_pty(int *pty, int *tty);
764 * This function opens up a pty master and stuffs its value into pty.
767 * so that if a pty master is found and later, we find that the slave
772 get_pty(int *pty, int *tty)
775 if (openpty(pty, tty, NULL, NULL, NULL) == -1) {
783 if ((*pty = open ("/dev/ptmx", O_RDWR)) < 0)
785 grantpt(*pty);
786 unlockpt(*pty);
787 strcpy(ttydev, (char *)ptsname(*pty));
793 if (*pty >= 0)
794 close (*pty);
797 if ((*pty = getpseudotty (&ttydev, &ptydev)) >= 0 &&
800 if (*pty >= 0)
801 close (*pty);
814 if ((*pty = open (ptydev, O_RDWR)) >= 0 &&
824 if (*pty >= 0)
825 close (*pty);
834 * We were unable to allocate a pty master! Return an error