Lines Matching refs:pmtab

64 tmchild(pmtab)  in tmchild()  argument
65 struct pmtab *pmtab; in tmchild()
75 if (pmtab->p_status != GETTY) {
93 if (pmtab->p_ttyflags & (C_FLAG|B_FLAG)) {
94 if (pmtab->p_fd > 0) {
95 (void) close(pmtab->p_fd);
96 pmtab->p_fd = 0;
106 speedef = get_speed(pmtab->p_ttylabel);
107 openline(pmtab, speedef);
108 if (pmtab->p_ttyflags & (C_FLAG|B_FLAG)) {
109 if (pmtab->p_fd >= 0) {
110 if ((pmtab->p_modules != NULL)&&(*(pmtab->p_modules) != '\0')) {
111 if (push_linedisc(pmtab->p_fd, pmtab->p_modules, pmtab->p_device) == -1) {
112 (void) close(pmtab->p_fd);
118 if ((pmtab->p_ttyflags & C_FLAG) &&
120 (!(pmtab->p_flags & X_FLAG))) {
129 invoke_service(pmtab);
133 auto_speed = do_autobaud(pmtab, speedef);
139 if ((pmtab->p_ttyflags & (R_FLAG|A_FLAG)) ||
140 (pmtab->p_status == GETTY) || (pmtab->p_timeout > 0)) {
141 write_prompt(1, pmtab, TRUE, TRUE);
142 if (pmtab->p_timeout) {
147 (void) alarm((unsigned)pmtab->p_timeout);
150 else if ((pmtab->p_ttyflags & (B_FLAG)))
151 write_prompt(pmtab->p_fd, pmtab, TRUE, TRUE);
163 if (pmtab->p_timeout) {
170 if ((State == PM_DISABLED)||(pmtab->p_flags & X_FLAG)){
171 write_prompt(1, pmtab, TRUE, FALSE);
179 invoke_service(pmtab);
192 auto_speed = do_autobaud(pmtab, speedef);
208 write_prompt(1, pmtab, TRUE, TRUE);
215 write_prompt(1, pmtab, FALSE, FALSE);
221 if (pmtab->p_timeout) {
226 (void) alarm((unsigned)pmtab->p_timeout);
232 openline(pmtab, speedef) in openline() argument
233 struct pmtab *pmtab; in openline()
243 if (pmtab->p_status != GETTY) {
246 if ((pmtab->p_fd = open(pmtab->p_device, O_RDWR)) != 0) {
247 log("open \"%s\" failed: %s", pmtab->p_device,
257 if (pmtab->p_ttyflags & R_FLAG) { /* wait_read is needed */
258 if (pmtab->p_count) {
262 pmtab->p_count--;
278 for (line_count = 0; line_count < pmtab->p_count; ) {
309 if (!(pmtab->p_ttyflags & A_FLAG)) { /* autobaud not enabled */
316 if (pmtab->p_ttyflags & B_FLAG) { /* port is bi-directional */
339 write_prompt(fd, pmtab, flush, clear) in write_prompt() argument
341 struct pmtab *pmtab;
357 if ((State == PM_DISABLED) || (pmtab->p_flags & X_FLAG))
358 (void)write(fd, pmtab->p_dmsg, (unsigned)strlen(pmtab->p_dmsg));
360 (void) write(fd, pmtab->p_prompt,
361 (unsigned)strlen(pmtab->p_prompt));
413 do_autobaud(pmtab, speedef) in do_autobaud() argument
414 struct pmtab *pmtab; in do_autobaud()
423 if ((auto_speed = autobaud(0, pmtab->p_timeout)) == NULL) {
500 invoke_service(pmtab) in invoke_service() argument
501 struct pmtab *pmtab; in invoke_service()
515 "tty on \"%s\",\n", pmtab->p_device);
519 if (strcmp("/dev/console", pmtab->p_device) != 0) {
526 pmtab->p_device);
532 if (pmtab->p_status != GETTY) {
540 if (pmtab->p_flags & U_FLAG) {
541 if (account(pmtab->p_device) != 0) {
548 mkargv(pmtab->p_server, &argvp[0], &cnt, MAXARGS-1);
550 if (!(pmtab->p_ttyflags & C_FLAG)) {
551 (void) sprintf(pbuf, "TTYPROMPT=%s", pmtab->p_prompt);
557 if (pmtab->p_status != GETTY) {
558 (void) sprintf(hbuf, "HOME=%s", pmtab->p_dir);
566 if ((i = doconfig(0, pmtab->p_tag, 0)) != 0) {
572 i, pmtab->p_tag);
578 if (setgid(pmtab->p_gid)) {
579 log("cannot set group id to %ld: %s", pmtab->p_gid,
584 if (setuid(pmtab->p_uid)) {
585 log("cannot set user id to %ld: %s", pmtab->p_uid,
590 if (chdir(pmtab->p_dir)) {
591 log("cannot chdir to %s: %s", pmtab->p_dir, strerror(errno));
595 if (pmtab->p_uid != ROOTUID) {
597 (void) fchown(0, pmtab->p_uid, Tty_gid);
602 if (pmtab->p_status != GETTY) {
612 log("Starting service (%s) on %s", argvp[0], pmtab->p_device);
615 if (pmtab->p_termtype != (char *)NULL) {
616 (void) sprintf(tbuf, "TERM=%s", pmtab->p_termtype);