Lines Matching refs:pty

150 #include <pty.h>		/* openpty() */
180 #include <pty.h>
337 #define UTEMPTER_ADD(pty,hostname,master_fd) utempter_add_record(master_fd, hostname)
340 #define UTEMPTER_ADD(pty,hostname,master_fd) addToUtmp(pty, hostname, master_fd)
468 static int pty_search(int * /* pty */ );
471 static int get_pty(int *pty, char *from);
486 static int really_get_pty(int *pty, char *from);
831 static char *passedPty = noPassedPty; /* name if pty if slave */
1282 { "-/+ie", "turn on/off initialization of 'erase' from pty" },
1984 * Set the tty/pty identifier
2001 * The original -S option accepts two characters to identify the pty, and a
2048 * pty implementation allows more than 3 digits.
2059 * Legend does not support old-style pty's, has no related compatibility
2428 #define get_pty(pty, from) really_get_pty(pty, from)
2975 * to the slave-pty process when xterm exits.
3086 * This function opens up a pty master and stuffs its value into pty.
3090 * so that if a pty master is found and later, we find that the slave
3094 get_pty(int *pty, char *from GCC_UNUSED)
3099 result = openpty(pty, &opened_tty, ttydev, NULL, NULL);
3105 if ((*pty = posix_openpt(O_RDWR)) >= 0) {
3106 char *name = ptsname(*pty);
3114 result = pty_search(pty);
3118 result = ((*pty = openrpty(ttydev, ptydev,
3122 result = pty_search(pty);
3125 result = ((*pty = open("/dev/ptmx", O_RDWR)) < 0);
3128 strcpy(ttydev, ptsname(*pty));
3133 if ((*pty = open("/dev/ptc", O_RDWR)) >= 0) {
3134 strcpy(ttydev, ttyname(*pty));
3143 if ((*pty = open(pty_name, O_RDWR)) >= 0) {
3154 result = ((*pty = getpseudotty(&ttydev, &ptydev)) < 0);
3160 tty_name = _getpty(pty, O_RDWR, 0622, 0);
3169 *pty = open("/dev/ptc", O_RDWR);
3170 if (*pty >= 0 && (fstat(*pty, &fstat_buf)) >= 0) {
3179 if ((*pty = open("/dev/ptym/clone", O_RDWR)) >= 0) {
3180 char *name = ptsname(*pty);
3185 close(*pty);
3186 *pty = -1;
3187 result = pty_search(pty);
3190 result = pty_search(pty);
3195 result = pty_search(pty);
3204 pty != NULL ? *pty : -1));
3232 get_pty(int *pty, char *from)
3237 if (pty == NULL) {
3246 *pty = m_pty;
3255 pty != 0 ? *pty : -1));
3269 * a functional interface for allocating a pty.
3270 * Returns 0 if found a pty, 1 if fails.
3274 pty_search(int *pty)
3285 if ((*pty = open(ptydev, O_RDWR)) >= 0) {
3300 if ((*pty = open(ptydev, O_RDWR)) >= 0) {
3302 /* Need to check the process group of the pty.
3303 * If it exists, then the slave pty is in use,
3307 if (ioctl(*pty, TIOCGPGRP, &pgrp_rtn) == 0 || errno != EIO) {
3308 close(*pty);
3320 * We were unable to allocate a pty master! Return an error
3389 PTY_BAD, /* c->p: can't open pty slave for some reason */
3390 PTY_FATALERROR, /* c->p: we had a fatal error with the pty */
3391 PTY_GOOD, /* c->p: we have a good pty, let's go on */
3392 PTY_NEW, /* p->c: here is a new pty slave, try this */
3393 PTY_NOMORE, /* p->c; no more pty's, terminate */
3487 xtermWarning("fatal pty error errno=%d, error=%d device \"%s\"\n",
3528 xtermWarning("fatal pty error %d (errno=%d) on tty %s\n",
3909 * Inits pty and tty and forks a login process.
3911 * If slave, the pty named in passedPty is already open for use
4016 * Sometimes /dev/tty hangs on open (as in the case of a pty
4120 * If ptyInitialErase is set, we want to get the pty's
4148 "pty");
4301 TRACE(("...calling addToUtmp(pty=%s, hostname=%s, master_fd=%d)\n",
4412 /* we don't need the socket, or the pty master anymore */
4418 * open up the pty slave.
4460 * the process group leader for the pty. If
4499 /* We have a new pty to try */
4538 * child pty.
4653 /* make sure speed is set on pty so that editors work right */
5200 TRACE(("should we reset screensize after pty-handshake?\n"));
5365 /* The open of the pty failed! Let's get
5615 /* restore ownership of tty and pty */