Skip to content

termios: support arbitrary baud rates with glibc 2.42+ on Linux #5230

Description

@decathorpe

glibc 2.42.0 made API / ABI changes to expose arbitrary baud rates in the functions from <termios.h>:

  • On Linux, the <termios.h> interface now supports arbitrary baud rates;
    speed_t is redefined to simply be the baud rate specified as an
    unsigned int, which matches the kernel interface.

https://lists.gnu.org/archive/html/info-gnu/2025-07/msg00011.html

Since 0.2.179, libc explicitly links against the symbols from the old ABI that only exposes the baud rate as enum constants: #4882

It would be nice if the libc crate could expose functions that accept / return arbitrary baud rates on Linux too. It looks like this is already the case on *BSD, and only on Linux and Android, the old enums are still used (at least according to the docs for the nix crate).

Alternatively, the existing APIs in libc could start targeting the new glibc ABI in a future major version of the libc crate - but it's possibly too late for 1.0.0, since it would require raising the minimum supported glibc version to 2.42 - which unfortunately would mean that it would take ages for those APIs to ever change to what is exposed by the underlying platform?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions