Lines Matching refs:G

111 #define G (*ptr_to_globals)  macro
113 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
165 G.speeds[G.numspeed] = bcode(cp); in parse_speeds()
166 if (G.speeds[G.numspeed] < 0) in parse_speeds()
169 G.numspeed++; in parse_speeds()
170 if (G.numspeed > MAX_SPEED) in parse_speeds()
183 &G.initstring, &G.fakehost, &G.issue, in parse_args()
184 &G.login, &G.timeout in parse_args()
187 G.initstring = xstrdup(G.initstring); in parse_args()
189 strcpy_and_process_escape_sequences(G.initstring, G.initstring); in parse_args()
195 G.tty_name = argv[0]; in parse_args()
199 G.tty_name = ts; /* tty name is in argv[1] */ in parse_args()
214 if (NOT_LONE_DASH(G.tty_name)) { in open_tty()
215 if (G.tty_name[0] != '/') in open_tty()
216 G.tty_name = xasprintf("/dev/%s", G.tty_name); /* will leak it */ in open_tty()
221 xopen(G.tty_name, O_RDWR | O_NONBLOCK); /* uses fd 0 */ in open_tty()
238 G.tty_name = n; in open_tty()
240 applet_name = xasprintf("getty: %s", skip_dev_pfx(G.tty_name)); in open_tty()
245 if (tcsetattr_stdin_TCSANOW(&G.tty_attrs) < 0) in set_tty_attrs()
274 cfsetspeed(&G.tty_attrs, speed); in init_tty_attrs()
281 G.tty_attrs.c_cflag &= (0 in init_tty_attrs()
301 G.tty_attrs.c_cflag |= CS8 | HUPCL | CREAD; in init_tty_attrs()
307 G.tty_attrs.c_cflag |= CLOCAL; in init_tty_attrs()
311 G.tty_attrs.c_cflag |= CRTSCTS; /* flow control using RTS/CTS pins */ in init_tty_attrs()
313 G.tty_attrs.c_iflag = 0; in init_tty_attrs()
314 G.tty_attrs.c_lflag = 0; in init_tty_attrs()
316 G.tty_attrs.c_oflag = OPOST | ONLCR; in init_tty_attrs()
319 G.tty_attrs.c_cc[VMIN] = 1; in init_tty_attrs()
321 G.tty_attrs.c_cc[VTIME] = 0; in init_tty_attrs()
323 G.tty_attrs.c_line = 0; in init_tty_attrs()
336 G.tty_attrs.c_iflag |= IXON | IXOFF; in finalize_tty_attrs()
337 if (G.eol == '\r') { in finalize_tty_attrs()
338 G.tty_attrs.c_iflag |= ICRNL; /* map CR on input to NL */ in finalize_tty_attrs()
367 G.tty_attrs.c_lflag |= ICANON | ISIG | ECHO | ECHOE | ECHOK | ECHOKE | ECHOCTL; in finalize_tty_attrs()
384 G.tty_attrs.c_cc[VINTR] = CTL('C'); in finalize_tty_attrs()
385 G.tty_attrs.c_cc[VQUIT] = CTL('\\'); in finalize_tty_attrs()
386 G.tty_attrs.c_cc[VEOF] = CTL('D'); in finalize_tty_attrs()
387 G.tty_attrs.c_cc[VEOL] = '\n'; in finalize_tty_attrs()
389 G.tty_attrs.c_cc[VSWTC] = 0; in finalize_tty_attrs()
392 G.tty_attrs.c_cc[VSWTCH] = 0; in finalize_tty_attrs()
394 G.tty_attrs.c_cc[VKILL] = CTL('U'); in finalize_tty_attrs()
430 G.tty_attrs.c_cc[VMIN] = 0; /* don't block reads (min read is 0 chars) */ in auto_baud()
438 nread = safe_read(STDIN_FILENO, G.line_buf, sizeof(G.line_buf) - 1); in auto_baud()
442 G.line_buf[nread] = '\0'; in auto_baud()
443 for (bp = G.line_buf; bp < G.line_buf + nread; bp++) { in auto_baud()
447 cfsetspeed(&G.tty_attrs, speed); in auto_baud()
454 G.tty_attrs.c_cc[VMIN] = 1; /* restore to value set by init_tty_attrs */ in auto_baud()
475 print_login_issue(G.issue, G.tty_name); in get_logname()
480 bp = G.line_buf; in get_logname()
495 G.eol = c; in get_logname()
499 G.tty_attrs.c_cc[VERASE] = c; in get_logname()
500 if (bp > G.line_buf) { in get_logname()
506 while (bp > G.line_buf) { in get_logname()
518 if (G.numspeed > 1) in get_logname()
524 } else if ((int)(bp - G.line_buf) < sizeof(G.line_buf) - 1) { in get_logname()
533 } while (G.line_buf[0] == '\0'); /* while logname is empty */ in get_logname()
535 return G.line_buf; in get_logname()
557 G.login = _PATH_LOGIN; /* default login program */ in getty_main()
559 G.issue = ISSUE; /* default issue file */ in getty_main()
561 G.eol = '\r'; in getty_main()
671 if (tcgetattr(STDIN_FILENO, &G.tty_attrs) < 0) in getty_main()
675 update_utmp(pid, LOGIN_PROCESS, G.tty_name, "LOGIN", G.fakehost); in getty_main()
679 init_tty_attrs(G.speeds[0]); in getty_main()
684 full_write1_str(G.initstring); in getty_main()
694 alarm(G.timeout); /* if 0, alarm is not set */ in getty_main()
720 baud_index = (baud_index + 1) % G.numspeed; in getty_main()
721 cfsetspeed(&G.tty_attrs, G.speeds[baud_index]); in getty_main()
735 BB_EXECLP(G.login, G.login, "--", logname, (char *)0); in getty_main()
736 bb_error_msg_and_die("can't execute '%s'", G.login); in getty_main()