[PATCH 0/5] termios: _SPEED_MAX and _BAUD_MAX, manual improvements

H. Peter Anvin hpa@zytor.com
Sun Jun 29 16:09:01 GMT 2025


I have been working on an infill library for the baud_t interface, for
non-glibc and retro-glibc platforms.  In the process, I discovered
that it would be really useful to have defined constants for the range
of speed_t and baud_t.

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.

I propose the two constants _SPEED_MAX and _BAUD_MAX; the naming is
based on the typical max constants in C and POSIX like INT_MAX and
SIZE_MAX, with an additional underscore to avoid stomping on the user
namespace.

Please check that the locations of these definitions are reasonable.

The intent is for these constants to be included in the proposal to
the POSIX committee to standardize the baud_t interface.

In the process, I started looking at the manual, and found that there
were a lot of things in the manual section on terminals that were
either confusing or outright incorrect.  As a result, I ended up
making a major (proposed) edit to terminal.texi which I hope can be
useful.  Note that I'm not particularly proficient in texinfo, so I'm
hoping I have done this in a reasonable way.

 bits/termios-baud.h  |   5 +-
 manual/terminal.texi | 446 +++++++++++++++++++++++++++++++++++----------------
 termios/termios.h    |   1 +
 3 files changed, 312 insertions(+), 140 deletions(-)


More information about the Libc-alpha mailing list