agetty \- alternative Linux getty
.SH SYNOPSIS
-.BR "agetty " [\-8ihLmnsUw]
+.BR "agetty " [\-c8ihLmnsUw]
.RI "[-f " issue_file ]
.RI "[-l " login_program ]
.RI "[-I " init ]
.fi
.ad
.TP
+\-c
+Don't reset terminal cflags (control modes). See \fItermios(3)\fP for more
+details.
+.TP
\-8
Assume that the tty is 8-bit clean, hence disable parity detection.
.TP
#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 */
+#define F_KEEPCFLAGS (1<<10) /* Reuse c_cflags setup from kernel */
/* Storage for things detected while the login name was read. */
extern int optind; /* getopt */
int c;
- while (isascii(c = getopt(argc, argv, "8I:LH:f:hil:mst:wUn"))) {
+ while (isascii(c = getopt(argc, argv, "8cI:LH:f:hil:mst:wUn"))) {
switch (c) {
+ case 'c':
+ op->flags |= F_KEEPCFLAGS;
+ break;
case '8':
op->eightbits = 1;
break;
/* flush input and output queues, important for modems! */
(void) tcflush(0, TCIOFLUSH);
- tp->c_cflag = CS8 | HUPCL | CREAD | (tp->c_cflag & CLOCAL);
+ if (!(op->flags & F_KEEPCFLAGS))
+ tp->c_cflag = CS8 | HUPCL | CREAD | (tp->c_cflag & CLOCAL);
if (!(op->flags & F_KEEPSPEED)) {
cfsetispeed(tp, op->speeds[FIRST_SPEED]);