1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-11-23 00:02:50 +03:00
Files
glibc/sysdeps/unix/sysv/linux
H. Peter Anvin 8d999a6993 linux/termios: clear k_termios.c_cflag & CIBAUD for non-split speed [BZ 33340]
After getting more experience with the various broken direct-to-ioctl
termios2 hacks using Fedora 43 beta, I have found a fair number of
cases where the software would fail to set, or clear CIBAUD for
non-split-speed operation.

Thus it seems will help improve compatibility to clear the kernel-side
version of c_cflag & CIBAUD (having the same meaning to the Linux
kernel as the speed 0 has for cfsetibaud(), i.e. force the input speed
to equal the output speed) for non-split-speed operation, rather than
having it explicitly equal the output speed in CBAUD.

When writing the code that went into glibc 2.42 I had considered this
issue, and had to make an educated guess which way would be more
likely to break fewer things.  Unfortunately, it appears I guessed
wrong.

A third option would be to *always* set CIBAUD to __BOTHER, even for
the standard baud rates.  However, that is an even bigger departure
from legacy behavior, whereas this variant mostly preserves current
behavior in terms of under what conditions buggy utilities will
continue to work.

This change is in tcsetattr() rather than
___termios2_canonicalize_speeds(), as it should not be run for
tcgetattr(); that would break split speed support for the legacy
interface versions of cfgetispeed() and cfsetispeed().

[ v2: fixed comment style ]

Resolves: BZ #33340
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-11-18 12:04:55 +08:00
..
2025-11-12 15:27:28 -03:00
2025-10-10 14:52:40 +01:00
2025-01-10 20:19:40 +00:00
2025-11-12 15:27:28 -03:00
2025-01-30 10:16:37 -03:00
2025-01-30 10:16:37 -03:00
2025-11-12 15:27:28 -03:00
2025-11-12 15:27:28 -03:00
2025-11-12 15:27:28 -03:00