From: "David Dyck" <firstname.lastname@example.org>
> It turns out also that the O_WRONLY channel had CREAD turned off,
> which I would expect was appropriate for an output channel, and
> in 2.2 kernels, it didn't affect the O_RDONLY channel. If I enable
> the CREAD bit in termios c_cflag register for the O_WRONLY channel also
> then the select on the O_RDONLY channel reports characters available.
> I suspect that there is a different level of information sharing
> between the 2 channels that are open, but which is the correct behaviour,
> and why?
CREAD handling was changed to be correct; recently, but I don't know
exactly when. The 2.4 vs 2.2 difference sounds about right though.
Previously CREAD had been incorrectly handled by the driver and hadn't
been changed because some apps would break. Now data is correctly
ignored on receive when CREAD is off.
When you talk about the "O_WRONLY channel" and the "O_RDONLY channel"
you're not actually referring to separate things. Each serial port is
represented in the kernel as one entity that may be opened different
ways, possibly multiple times.
When you turn off CREAD in your write side, you turn off CREAD for the
whole port, including the read only side. This is not a bug in the
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to email@example.com
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Tue May 07 2002 - 22:00:11 EST