Re: ttyS1 hangs, cua1 works fine

Richard B. Johnson (root@chaos.analogic.com)
Mon, 6 Apr 1998 15:10:22 -0400 (EDT)


On Mon, 6 Apr 1998, Theodore Y. Ts'o wrote:

> Date: Mon, 6 Apr 1998 08:32:28 -0400 (EDT)
> From: "Richard B. Johnson" <root@chaos.analogic.com>
[SNIPPED]
>
> This code may be correct today, but it's not portable. That was what
> Gert was saying. For example, POSIX-compliant OS is free to define new
> termios flags, some of which must be set for normal operation.
>
> For example, that as an exampel the (fictional) termios cflag
> C_DONT_RANDOMLY_LOSE --- which is used to implement RFC-748, the Telnet
> Randomly-Lose option. :-)
>
> It's not a structure member, but a new flag defined in the termios
> structure. If you just bzero the structure and set the flags you want,
> you might end up clearing the C_DONT_RANDOMLY_LOSE option, with
> disastrous effects.
>
> That's why the well-written POSIX-complaint program will do a
> tcgetattr(), set or clear the flags the programmer wants, and then do a
> tcsetattr(). The POSIX specification very explicitly and strongly
> contains this suggestion.
>

I zeroed the structure to make damn certain that there were no hidden
bits that were preventing the proper function of the device. Don't
lose track of the reason for the whole exercise was to show that we
don't need cua* and that ttyS* works perfectly well.

I set the flags that were presently-defined to perform the intended
function. The function worked as specified.

After I was through, I put back whatever existed when I opened the
device.

This cannot be faulted.

If there were hidden flag bits, which there were not, then the structure
is improperly defined, which it is not.

I'm very troubled that every time I try to help somebody, certain
persons, usually the same ones, respond like this.

Cheers,
Dick Johnson
***** FILE SYSTEM MODIFIED *****
Penguin : Linux version 2.1.92 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu