On Thursday 27 March 2008, Karel Zak wrote: > On Thu, Mar 27, 2008 at 01:17:10AM +0100, Tilman Schmidt wrote: > > >>> Why we cannot use standard /usr/include/termios.h? > > > > It compiles alright, but it doesn't work: > > > > ts@xenon:~/util-linux-ng/sys-utils> ./ldattach -s 9600 M101 /dev/ttyS0 > > ldattach: cannot get terminal attributes for /dev/ttyS0: Invalid argument > > Sure... this is completely wrong way. (Sorry, I didn't read glibc > termios code before.) We cannot use glibc termios for ioctl(). The glibc > tcsetattr() translates glibc termios to kernel termios... > > > I'm not sure how to solve this: > > - Drop the entire idea of supporting arbitrary bitrates portably? I've > > got half a mind to do that by now. > > I don't think that we have to care about difference between termios > and termios2. It's glibc job (and glibc supports the new method > when available). > > My suggestion is to use standard libc functions (cfset{i,o}speed(), > tcsetattr() and tcgetattr()). the idea was to use the termios2 stuff until glibc acquired the functionality in question. it doesnt have it today even in cvs head. but if it's too much of a pain to handle cleanly ... -mike
Attachment:
signature.asc
Description: This is a digitally signed message part.