Re: [PATCH v5 2/2] gdb/ser-unix: add POSIX cfsetispeed/cfsetospeed support for custom baud rates

Eli Zaretskii
2026-03-24T17:16:16Z

> From: sunilkumar.dora@windriver.com
> Cc: SunilKumar.Dora@windriver.com, kevinb@redhat.com, macro@orcam.me.uk,
> eliz@gnu.org, Randy.MacLeod@windriver.com,
> Sundeep.Kokkonda@windriver.com, schwab@linux-m68k.org,
> tromey@sourceware.org, simark@simark.ca
> Date: Tue, 24 Mar 2026 09:45:27 -0700
>
> From: Sunil Dora <sunilkumar.dora@windriver.com>
>
> glibc 2.42 and later, and GNU Hurd, accept arbitrary baud rates
> directly via cfsetispeed and cfsetospeed. This behaviour is expected
> to be standardized in a future POSIX revision.
>
> Introduce a configure-time test (HAVE_CFSETSPEED_ARBITRARY) that
> detects this capability and add a new platform-agnostic helper
> set_custom_baudrate_posix. The main dispatcher now prefers the POSIX
> path when it is available, falling back to the existing Linux (BOTHER)
> or Darwin (IOSSIOSPEED) implementations otherwise.
>
> The HAVE_CUSTOM_BAUDRATE_SUPPORT guard is extended to also cover the
> new POSIX case.
>
> Suggested-by: Kevin Buettner <kevinb@redhat.com>
> Suggested-by: Maciej W. Rozycki <macro@orcam.me.uk>
> Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
> ---
> gdb/NEWS | 6 ++++++
> gdb/config.in | 3 +++
> gdb/configure | 39 ++++++++++++++++++++++++++++++++++++++
> gdb/configure.ac | 19 +++++++++++++++++++
> gdb/ser-unix.c | 49 +++++++++++++++++++++++++++++++++++++++---------
> 5 files changed, 107 insertions(+), 9 deletions(-)

Thanks, the NEWS part is okay.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>