Re: ldattach: struct termios

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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()).

 Is there any way how to test ldattach(8)? Do you have any simple
 test (I don't have GIGASET_M101;-) ?

    Karel


-- 
 Karel Zak  <kzak@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux