Lines Matching +full:master +full:- +full:side

150 #  define	cfsetospeed(tp, val)	(tp)->c_cflag &= ~CBAUD; \
151 (tp)->c_cflag |= (val)
152 # define cfgetospeed(tp) ((tp)->c_cflag & CBAUD)
154 # define cfsetispeed(tp, val) (tp)->c_cflag &= ~CIBAUD; \
155 (tp)->c_cflag |= ((val)<<IBSHIFT)
156 # define cfgetispeed(tp) (((tp)->c_cflag & CIBAUD)>>IBSHIFT)
158 # define cfsetispeed(tp, val) (tp)->c_cflag &= ~CBAUD; \
159 (tp)->c_cflag |= (val)
160 # define cfgetispeed(tp) ((tp)->c_cflag & CBAUD)
165 static int ttyfd = -1;
329 if ((numptys = sysconf(_SC_CRAY_NPTY)) != -1) in getnpty()
340 * Allocate a pty. As a side effect, the external character
341 * array "line" contains the name of the slave side.
346 static int ptyslavefd = -1;
370 int master; in getpty() local
372 if(openpty(&master, &slave, line, 0, 0) == 0){ in getpty()
374 return master; in getpty()
380 int master; in getpty() local
382 p = _getpty(&master, O_RDWR, 0600, 1); in getpty()
384 return -1; in getpty()
386 return master; in getpty()
506 /* no tty side to pty so skip it */ in getpty()
512 return(-1); in getpty()
702 { -1, 0 }
712 for (tp = termspeeds; (tp->speed != -1) && (val > tp->speed); tp++) in tty_tspeed()
714 if (tp->speed == -1) /* back up to last valid value */ in tty_tspeed()
715 --tp; in tty_tspeed()
716 cfsetospeed(&termbuf, tp->value); in tty_tspeed()
728 for (tp = termspeeds; (tp->speed != -1) && (val > tp->speed); tp++) in tty_rspeed()
730 if (tp->speed == -1) /* back up to last valid value */ in tty_rspeed()
731 --tp; in tty_rspeed()
732 cfsetispeed(&termbuf, tp->value); in tty_rspeed()
763 return -1; in my_find()
770 return -1; in my_find()
798 for(p--; p >= modules; p--){ in maybe_push_modules()
809 * Open the slave side of the pty, and do any initialization
811 * for the slave side.
815 int t = -1; in getptyslave()
819 * Opening the slave side may cause initilization of the in getptyslave()
824 * so that we can re-set them if we need to. in getptyslave()
935 if (login_tty(t) == -1) in getptyslave()
941 ourpty = -1; in getptyslave()
949 * Open the specified slave side of the pty,
957 if (ptyslavefd != -1) in cleanopen()
966 * slave side of the connection. in cleanopen()
979 return(-1); in cleanopen()
994 return(-1); in cleanopen()
1006 return(-1); in cleanopen()
1025 * Close the hard fd to /dev/ttypXXX, and re-open through in login_tty()
1034 * We get our controlling tty assigned as a side-effect in login_tty()
1106 * is necessary to startup the login process on the slave side of the pty.
1200 *envp++ -= 3; in init_env()
1320 * -h : pass on name of host. in start_login()
1321 * WARNING: -h is accepted by login if and only if in start_login()
1323 * -p : don't clobber the environment (so terminal type stays set). in start_login()
1325 * -f : force this login, he has already been authenticated in start_login()
1333 addarg(&argv, "-h"); in start_login()
1335 addarg(&argv, "-p"); in start_login()
1345 printf("Using one-time password\r\n"); in start_login()
1350 addarg(&argv, "-a"); in start_login()
1358 addarg(&argv, "-f"); in start_login()
1361 addarg(&argv, "--"); in start_login()
1369 * login. (The problem is that if the auto-login in start_login()
1395 if(argv->size <= argv->argc+1) { in addarg()
1396 argv->argv = realloc(argv->argv, sizeof(char*) * (argv->size + 10)); in addarg()
1397 if (argv->argv == NULL) in addarg()
1399 argv->size+=10; in addarg()
1401 if((argv->argv[argv->argc++] = strdup(val)) == NULL) in addarg()
1403 argv->argv[argv->argc] = NULL; in addarg()
1437 user0 = utxp->ut_user[0]; in rmut()
1438 utxp->ut_user[0] = '\0'; in rmut()
1439 utxp->ut_type = DEAD_PROCESS; in rmut()
1442 utxp->ut_exit.__e_termination = 0; in rmut()
1443 utxp->ut_exit.__e_exit = 0; in rmut()
1445 utxp->ut_exit.ut_termination = 0; in rmut()
1446 utxp->ut_exit.ut_exit = 0; in rmut()
1448 utxp->ut_exit.e_termination = 0; in rmut()
1449 utxp->ut_exit.e_exit = 0; in rmut()
1453 utxp->ut_tv.tv_sec = tv.tv_sec; in rmut()
1454 utxp->ut_tv.tv_usec = tv.tv_usec; in rmut()
1458 utxp->ut_user[0] = user0; in rmut()
1505 if (strncmp(u->ut_line, in rmut()
1507 sizeof(u->ut_line)) || in rmut()
1508 u->ut_name[0]==0) in rmut()
1510 lseek(f, ((long)u)-((long)utmp), L_SET); in rmut()
1511 strncpy(u->ut_name, "", sizeof(u->ut_name)); in rmut()
1513 strncpy(u->ut_host, "", sizeof(u->ut_host)); in rmut()
1515 u->ut_time = time(NULL); in rmut()
1557 utptr->ut_type = DEAD_PROCESS; in rmut()
1558 utptr->ut_time = time(NULL); in rmut()
1610 while (waitpid(-1, &child_status, flags) > 0) in cleanup()
1656 p = line + sizeof("/dev/") - 1; in cleanup()
1677 * the utmp file between the server and the soon-to-be-login shell.
1680 * signals the future-login shell to proceed.
1699 if ((int)(func = signal(SIGUSR1, _utmp_sig_rcv)) == -1) in utmp_sig_init()
1745 while ((jid = waitjob(NULL)) != -1) {
1768 if ( (cur->ut_type != NULL) && (jid == cur->ut_jid) ) {
1808 return(-1);
1813 if (utp->ut_type != USER_PROCESS || utp->ut_jid == 0)
1820 ret = jobend(utp->ut_jid, utp->ut_tpath, utp->ut_user);
1872 return(-1);
1875 cleantmpdir(jid, utp->ut_tpath, utp->ut_user);
1892 case -1: