[PATCH v4 0/3] termios: move baud_t interface under __USE_GNU, add SPEED_MAX|BAUD_MAX constants
H. Peter Anvin
hpa@zytor.com
Sun Jul 13 05:19:41 GMT 2025
I have dropped patches 1-3 from v3 of this patchset, since those were
pure documentation patches and have not changed. They are really
independent of these. This patchset needs to be applied ON TOP of
those three patches, however.
Patch 1 moves the baud_t interface from __USE_MISC to __USE_GNU, since
it is not a BSD or System V derived interface.
Patch 2 adds the constants SPEED_MAX and BAUD_MAX, containing the
maximum valid values for speed_t and baud_t, respectively. The need
for these constants became clear when I worked on an infill library
for the baud_t interface for non-glibc and retro-glibc platforms.
The intent is for these constants to be included in the proposal to
the POSIX committee to standardize the baud_t interface.
On *some* platforms, including glibc/Linux, the former was defined as
__MAX_BAUD, which I carried over to other platforms in my termios
enabling patches. However, it is rather confusing since it is called
"baud" while referring to speed_t.
Patch 3 documents these new constants and their semantics in the
manual. No functional change.
Git tree:
https://git.zytor.com/linux/glibc hpa/termios-manual
[ v2: remove a stray chunk in patch 3/5 left from editing ]
[ v3: dropped leading underscores, leave __MAX_BAUD outside
#ifdef __USE_MISC since it is a legacy symbol, and
namespace-protected with a double underscore.
(Collin Funk, Adhermerval Zanella Netto) ]
[ v4: move from __USE_MISC to __USE_GNU (Collin Funk), drop the
unrelated manual rewrite patches from v3. ]
---
bits/termios-baud.h | 5 ++++-
manual/terminal.texi | 18 ++++++++++++++++++
termios/termios.h | 3 +++
3 files changed, 25 insertions(+), 1 deletion(-)
More information about the Libc-alpha
mailing list