From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#49524: 28.0.50; make-serial-process is not portable Date: Sun, 11 Jul 2021 19:24:50 +0300 Message-ID: <834kd0byy5.fsf@gnu.org> References: <82e72be1-9907-c08f-0c1d-d625e914a902@cornell.edu> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9731"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 49524@debbugs.gnu.org To: Ken Brown Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 11 18:26:13 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2cHU-0002Ee-Pz for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Jul 2021 18:26:12 +0200 Original-Received: from localhost ([::1]:32964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2cHS-0002fB-QG for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Jul 2021 12:26:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2cHK-0002en-Gp for bug-gnu-emacs@gnu.org; Sun, 11 Jul 2021 12:26:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52475) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2cHK-0004OH-9P for bug-gnu-emacs@gnu.org; Sun, 11 Jul 2021 12:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2cHK-0005p9-4Z for bug-gnu-emacs@gnu.org; Sun, 11 Jul 2021 12:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Jul 2021 16:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49524 X-GNU-PR-Package: emacs Original-Received: via spool by 49524-submit@debbugs.gnu.org id=B49524.162602071222328 (code B ref 49524); Sun, 11 Jul 2021 16:26:02 +0000 Original-Received: (at 49524) by debbugs.gnu.org; 11 Jul 2021 16:25:12 +0000 Original-Received: from localhost ([127.0.0.1]:35788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2cGW-0005o4-7D for submit@debbugs.gnu.org; Sun, 11 Jul 2021 12:25:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2cGR-0005ng-Rj for 49524@debbugs.gnu.org; Sun, 11 Jul 2021 12:25:11 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52072) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2cGL-0003sQ-MK; Sun, 11 Jul 2021 12:25:01 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4900 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2cGL-0008Io-97; Sun, 11 Jul 2021 12:25:01 -0400 In-Reply-To: <82e72be1-9907-c08f-0c1d-d625e914a902@cornell.edu> (message from Ken Brown on Sun, 11 Jul 2021 11:24:58 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:209805 Archived-At: > From: Ken Brown > Date: Sun, 11 Jul 2021 11:24:58 -0400 > > Fmake_serial_process calls Fserial_process_configure, which calls > serial_configure, which calls cfsetspeed with the speed argument equal to the > numerical baud rate (e.g., 9600). But the documentation of cfsetspeed says that > the speed argument must be one of the Bnnn constants defined in termios.h (e.g., > B9600). See, for example, > > https://man7.org/linux/man-pages/man3/termios.3.html > > This incorrect call of cfsetspeed happens to succeed on GNU/Linux because > glibc's cfsetspeed allows the argument to be the numerical baud rate, which it > converts to the appropriate Bnnn constant. But I don't think emacs should be > relying on this undocumented behavior. In particular, this doesn't work on > Cygwin. And it wouldn't even work on GNU/Linux if emacs used the cfsetspeed > replacement defined in sysdep.c instead of glibc's cfsetspeed. > > I think the way to fix this is to imitate the glibc code that converts the baud > rate to a Bnnn constant, but maybe someone has a better idea. Converting in sysdep.c:serial_configure sounds TRT to me.