agetty \- alternative Linux getty
.SH SYNOPSIS
-.BR "agetty " [\-8ihLmnUw]
+.BR "agetty " [\-8ihLmnsUw]
.RI "[-f " issue_file ]
.RI "[-l " login_program ]
.RI "[-I " init ]
.I port
.I baud_rate,...
.RI [ term ]
-.br
-.BR "agetty " [\-8ihLmnw]
-.RI "[-f " issue_file ]
-.RI "[-l " login_program ]
-.RI "[-I " init ]
-.RI "[-t " timeout ]
-.RI "[-H " login_host ]
-.I baud_rate,...
-.I port
-.RI [ term ]
.SH DESCRIPTION
.ad
be useful when you have a locally attached terminal where the serial line
does not set the carrier detect signal.
.TP
+\-s
+Try to keep the existing baud rate. The baud rates from
+the command line are used when agetty receives a BREAK character.
+.TP
\-U
Turn on support for detecting an uppercase only terminal. This setting will
detect a login name containing only capitals as indicating an uppercase
#define F_CUSTISSUE (1<<6) /* give alternative issue file */
#define F_NOPROMPT (1<<7) /* don't ask for login name! */
#define F_LCUC (1<<8) /* Support for *LCUC stty modes */
+#define F_KEEPSPEED (1<<9) /* Follow baud rate from kernel */
/* Storage for things detected while the login name was read. */
void parse_speeds P_((struct options *op, char *arg));
void update_utmp P_((char *line));
void open_tty P_((char *tty, struct termios *tp, int local));
-void termio_init P_((struct termios *tp, int speed, struct options *op));
+void termio_init P_((struct termios *tp, struct options *op));
void auto_baud P_((struct termios *tp));
void do_prompt P_((struct options *op, struct termios *tp));
void next_speed P_((struct termios *tp, struct options *op));
tcsetpgrp(0, getpid());
/* Initialize the termios settings (raw mode, eight-bit, blocking i/o). */
debug("calling termio_init\n");
- termio_init(&termios, options.speeds[FIRST_SPEED], &options);
+ termio_init(&termios, &options);
/* write the modem init string and DON'T flush the buffers */
if (options.flags & F_INITSTRING) {
extern int optind; /* getopt */
int c;
- while (isascii(c = getopt(argc, argv, "8I:LH:f:hil:mt:wUn"))) {
+ while (isascii(c = getopt(argc, argv, "8I:LH:f:hil:mst:wUn"))) {
switch (c) {
case '8':
op->eightbits = 1;
case 'n':
op->flags |= F_NOPROMPT;
break;
+ case 's':
+ op->flags |= F_KEEPSPEED; /* keep kernel defined speed */
+ break;
case 't': /* time out */
if ((op->timeout = atoi(optarg)) <= 0)
error(_("bad timeout value: %s"), optarg);
char area[1024];
void
-termio_init(tp, speed, op)
+termio_init(tp, op)
struct termios *tp;
- int speed;
struct options *op;
{
(void) tcflush(0, TCIOFLUSH);
tp->c_cflag = CS8 | HUPCL | CREAD;
- cfsetispeed(tp, speed);
- cfsetospeed(tp, speed);
+
+ if (!(op->flags & F_KEEPSPEED)) {
+ cfsetispeed(tp, op->speeds[FIRST_SPEED]);
+ cfsetospeed(tp, op->speeds[FIRST_SPEED]);
+ }
if (op->flags & F_LOCAL) {
tp->c_cflag |= CLOCAL;
}
void
usage()
{
- fprintf(stderr, _("Usage: %s [-8hiLmUw] [-l login_program] [-t timeout] [-I initstring] [-H login_host] baud_rate,... line [termtype]\nor\t[-hiLmw] [-l login_program] [-t timeout] [-I initstring] [-H login_host] line baud_rate,... [termtype]\n"), progname);
+ fprintf(stderr, _("Usage: %s [-8hiLmsUw] [-l login_program] [-t timeout] [-I initstring] [-H login_host] baud_rate,... line [termtype]\nor\t[-hiLmw] [-l login_program] [-t timeout] [-I initstring] [-H login_host] line baud_rate,... [termtype]\n"), progname);
exit(1);
}