Subject: problems with setting terminal speed
To: None <netbsd-users@NetBSD.ORG>
From: VaX#n8 <vax@carolina.rr.com>
List: netbsd-users
Date: 04/28/2004 16:24:40
I have a program which sets up a terminal interface to a serial device.
The old binary works, in which case stty -a -f /dev/tty01 gives:

speed 19200 baud; 0 rows; 0 columns;
lflags: -icanon -isig -iexten -echo echoe echok echoke -echonl -echoctl
        -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
        -extproc
iflags: -istrip -icrnl -inlcr -igncr -ixon -ixoff ixany -imaxbel -ignbrk
        -brkint inpck ignpar -parmrk
oflags: -opost -onlcr -ocrnl -oxtabs -onocr -onlret
cflags: cread cs8 -parenb -parodd -hupcl clocal -cstopb -crtscts -mdmbuf
        -cdtrcts
cchars: discard = M-?; dsusp = ^@; eof = ^_; eol = ^@; eol2 = ^@;
        erase = ^@; intr = ^B; kill = M-_; lnext = M-?; min = 212;
        quit = ^@; reprint = M-?; start = M-^D; status = M-?; stop = M-9;
        susp = ^@; time = 185; werase = M-p;

But I recompile the same code and it doesn't work.  Same stty command gives:

ispeed 0 baud; ospeed 9600 baud; 0 rows; 0 columns;
lflags: -icanon -isig -iexten -echo -echoe -echok -echoke -echonl
        -echoctl -echoprt -altwerase -noflsh -tostop -flusho -pendin
        -nokerninfo -extproc
iflags: -istrip -icrnl -inlcr -igncr -ixon -ixoff -ixany -imaxbel -ignbrk
        -brkint inpck -ignpar -parmrk
oflags: -opost -onlcr ocrnl oxtabs onocr onlret
cflags: cread cs8 -parenb -parodd -hupcl clocal -cstopb -crtscts -mdmbuf
        -cdtrcts
cchars: discard = ^@; dsusp = H; eof = H; eol = M-9; eol2 = M-?;
        erase = M-?; intr = ^@; kill = M-9; lnext = ^@; min = 31;
        quit = r; reprint = ^D; start = M-@; status = ^@; stop = ^@;
        susp = ^E; time = 0; werase = M-^_;

Note the speed differences.  In the old binary input and output are the
same speed.  In the new one I can't seem to set either speed.

I'm using cfsetispeed and tcsetattr.  I can change everything except the
speed.  Anyone got any ideas why?