[PATCH RFC v3 8/8] termios: add new baud_t interface, defined to be explicitly numeric
H. Peter Anvin
hpa@zytor.com
Mon May 12 18:15:47 GMT 2025
On 5/8/25 11:55, Adhemerval Zanella Netto wrote:
>
>
> On 03/05/25 22:43, H. Peter Anvin wrote:
>> Add an explicitly numeric interface for baudrate setting. For glibc,
>> this only announces what is a fair accompli, but this is a plausible
>> way forward for standardization, and may be possible to infill on
>> non-compliant systems. The POSIX committee has stated:
>>
>> [https://www.austingroupbugs.net/view.php?id=1916#c7135]
>>
>> A future version of this standard is expected to add at least
>> the following symbolic constants for use as values of objects
>> of type speed_t: B57600, B115200, B230400, B460800, and
>> B921600.
>>
>> Implementations are encouraged to propose additional
>> interfaces which will make it possible to set and query a
>> wider range of speeds than just those enumerated by the
>> constants beginning with B. If a set of common interfaces
>> emerges between several implementations, a future version of
>> this standard will likely add those interfaces.
>>
>> This is exactly that interface.
>>
>> The use of the term "baud" is due to the need to have a term
>> contrasting "speed", and it is already well established as a legacy
>> term -- including in the names of the legacy Bxxx
>> constants. Futhermore, it *is* valid from the point of view that the
>> termios interface fundamentally emulates an RS-232 serial port as far
>> as the application software is concerned.
>>
>> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
>
> The patch looks ok, but as for the fifth patch I think we should also
> add some minimal regressions tests for the newly added symbols.
>
Of course. I did post this as an RFC in part because of lack of tests.
-hpa
More information about the Libc-alpha
mailing list