It seems like the major problem was depending on cfmakeraw() to DTRT. That's a glibc extension, AFAICS. On top of that, it appears that GNU's cfmakeraw manpage is incomplete as to what it does.*

Add to that my lack of prowess with serial programming (and, as I said, lack of programming prowess in general), and it became very complicated.

Regardless, despite the time it took me to make it work, it's not a complicated fix. I don't really think you'd need my permission to fix it anyway, as you could just steal GNU's code, but you have my permission, nonetheless.


* Here's what the man page says:
cfmakeraw sets the terminal attributes as follows:

termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP
|INLCR|IGNCR|ICRNL|IXON);
termios_p->c_oflag &= ~OPOST;
termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
termios_p->c_cflag &= ~(CSIZE|PARENB);
termios_p->c_cflag |= CS8;
Here's the code from glibc-2.3.2 termios/cfmakeraw.c:
/* Set *T to indicate raw mode.  */

void
cfmakeraw (t)
struct termios *t;
{
t->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
t->c_oflag &= ~OPOST;
t->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
t->c_cflag &= ~(CSIZE|PARENB);
t->c_cflag |= CS8;
t->c_cc[VMIN] = 1; /* read returns when one char is available. */
t->c_cc[VTIME] = 0;
}
Fine work, GNU guys!
_________________________
Bitt Faulk