Re: [PATCH] ldattach(8)

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

 



On Saturday 09 February 2008, Tilman Schmidt wrote:
> Am 08.02.2008 05:01 schrieb Mike Frysinger:
> >> while i havent actually tested this, it should be fine.  termios2 was
> >> created because not all arches integrated the speed fields into the
> >> termios structure.  for those that did, there was no need for termios2.
> >>
> >> until these details get pushed into the libc, the code in ldattach prob
> >> needs to look something like:
> >>
> >> #ifndef TCGETS2
> >> #define termios2 termios
> >> #define TCGETS2 TCGETS
> >> #define TCSETS2 TCSETS
> >> #endif
> >> ...
> >> #ifdef BOTHER
> >> 	< do BOTHER / CBAUD stuff >
> >> 	if (ioctl( TCGETS ) works)
> >> 		return;
> >> #endif
> >> 	< normal speed functions >
> >>
> >> this way you can build a binary against newer headers but have it work
> >> OK on older kernels where TCGETS2 isnt implemented
>
> I'm afraid this isn't going to work on platforms which *did* integrate
> the speed fields into the termios structure, as there is no way to
> determine whether the retrieved termios structure does or doesn't
> contain the speed fields.

i dont really follow.  if an arch defines TCGETS2, you can assume the termios2 
struct exists (regardless of the speed status in the termios struct).  if an 
arch does not define TCGETS2, you cn assume the termios struct includes the 
speed members.

> I therefore solved it the other way around, 
> by using the old speed setting via Bnnn for those speeds supported by
> it, and resorting to the BOTHER mechanism only for speed values which
> don't have a Bnnn value.

the Bnnn list beyond 115200 is not consistent across arches :/
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


[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