From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id VlxEC4p0j2mfmzkAWB0awg (envelope-from ) for ; Fri, 13 Feb 2026 13:59:22 -0500 Received: by simark.ca (Postfix, from userid 112) id 0CCAF1E0BA; Fri, 13 Feb 2026 13:59:22 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 3A9861E08D for ; Fri, 13 Feb 2026 13:59:20 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id B18444BAD148 for ; Fri, 13 Feb 2026 18:59:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B18444BAD148 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by sourceware.org (Postfix) with ESMTP id 1371C4BA23F1; Fri, 13 Feb 2026 18:58:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1371C4BA23F1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=orcam.me.uk ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1371C4BA23F1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4190:8020::34 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771009129; cv=none; b=p0bBQZZ+NAeTG9oI04QfBeRpHSPFhzO3w3pnJ0O9zw3SeRN3GEHFRCka7GJEdoSYQNIM5H1phIssg4e/kfHuUx07t+3ZlYZfr3qVBeARtcOLeAjnqC2tZHtGfUTjOK+yaqAyoaWquEXzzD6HIA/oz/xJMVg8RZpphPHcmJyJkb4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771009129; c=relaxed/simple; bh=1eLu0QBobeAU5gIaeZeRGmpbPF+rLnVUsYYowO4VrJU=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=SywYwXBuwcOGud9S0mo2AwEUA8vfYpJ2a9aAYglXC50x4wE8W5iM9F/OafzM6+IAuhTxT2mfmvAUl9UAzAL63ppYDYMA7seV5Q7hie/XikldxSXYm3rPhS9HNGBB6WSbGSBrJ1C3dT1RJ+E+4pV3PBRvpm5JK2ADSKEnvfnr8ZA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1371C4BA23F1 Received: by angie.orcam.me.uk (Postfix, from userid 500) id 1EAE592009C; Fri, 13 Feb 2026 19:58:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 1D06C92009B; Fri, 13 Feb 2026 18:58:46 +0000 (GMT) Date: Fri, 13 Feb 2026 18:58:46 +0000 (GMT) From: "Maciej W. Rozycki" To: Kevin Buettner cc: sunilkumar.dora@windriver.com, gdb-patches@sourceware.org, simon.marchi@efficios.com, tromey@sourceware.org, Sundeep.Kokkonda@windriver.com Subject: Re: [PATCH] gdb/ser-unix: avoid musl build failure when setting custom baud rates In-Reply-To: <20260213110817.10346c83@f42-zbm-amd> Message-ID: References: <20260213152151.3224544-1-sunilkumar.dora@windriver.com> <20260213110817.10346c83@f42-zbm-amd> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On Fri, 13 Feb 2026, Kevin Buettner wrote: > 2) I don't think that it's correct to call cfsetospeed and cfsetispeed > with arbitrary baud rates. According to the man page, these > functions expect to be passed one of the "B" constants like B1200, > B9600, etc, not arbitrary speeds. The existing code which uses the > BOTHER extension is the correct way to do this. FYI as from v2.42 glibc finally does support arbitrary baud rates with `cfsetospeed' and `cfsetispeed' with Linux as well, in addition to Hurd, which it has been since forever. This is fully documented in the glibc manual; the man page you refer to is likely outdated. The BOTHER flag is the raw OS kernel interface and its direct use is discouraged. Cf. , , . The position of the POSIX committee WRT the API is quoted there. You can use autoconf to determine whether arbitrary baud rates are supported, by checking if one of the Bxxx macros expands to its numeric baud rate equivalent (you can check a couple if you feel pedantic). With older versions of glibc and possibly other C library implementations Bxxx macros have to be used of course and the choice of baud rates available this way is limited. Resorting to using the BOTHER flag might be the best approach, but the POSIX interface seems like the best first choice. Maciej