delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/07/12/04:17:21

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C45A383603E
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1626077839;
bh=9lSiat2S8cysRSGQzG0XEdI3KsBk4IbsIwKl5JsMJKw=;
h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=f9Tn8FQ+5w4kuN9BZYtdJFj+ewC9Z0dNy4f1EQ6gM+PqLPuROGReoCeEFotA0mAMV
oJ8CRF00BqQTKjn7ZPY59V6x03gKV7HKMgBkPE/+MCY92RmS5mAzC7MAhAanuYF65K
3Um4m9lUTh0l813vIMH78kKPcP9j8Fi0OttICrco=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 30C813861034
Date: Mon, 12 Jul 2021 10:16:42 +0200
To: cygwin AT cygwin DOT com
Subject: Re: cfsetspeed is not consistent with Linux
Message-ID: <YOv6an75uho0rRW7@calimero.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <466e52fb-bda0-b5c0-f201-033a85e8de29 AT cornell DOT edu>
MIME-Version: 1.0
In-Reply-To: <466e52fb-bda0-b5c0-f201-033a85e8de29@cornell.edu>
X-Provags-ID: V03:K1:L0f3phNeKufen4X/+Be5IB3MlmitcmBiLZHWoiwna4gL7bz7+u/
chRHeFFit6YCTrHxkpykILJX+wiDnwbm+pMqmgh6G6njNCqctLusfr/3wi8Nvq/s8un9/5i
H8LlRQsP83T6SCO0h97CH8KgToL6v+mi0v01vsoeRTnVIPblgtzWRnOpt93syXOVl5Sdz4W
939e0ZCRjJgz4rE/kpl+g==
X-UI-Out-Filterresults: notjunk:1;V03:K0:uCyFDeAHkd4=:EEhREV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_NEUTRAL,
TXREP autolearn=ham autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On Jul 11 12:33, Ken Brown via Cygwin wrote:
> While investigating an emacs bug
> (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49524), I noticed a
> difference in the behavior of cfsetspeed(3) on Cygwin and Linux.  I'm not
> sure we should "fix" this, because Cygwin's behavior is consistent with the
> Linux man page, and Linux's behavior is not.  But I thought I should point
> it out for the sake of discussion, because Cygwin generally tries to emulate
> Linux.  Here are the details:
> 
> The Linux man page for cfsetspeed(3) specifies that the speed argument must
> be one of the constants Bnnn (e.g., B9600) defined in termios.h.  But Linux
> in fact allows the speed to be the numerical baud rate (e.g., 9600).  Test
> case:
> [...]
> $ ./a.out
> Calling cfsetspeed with speed B9600
> cfgetispeed reports speed 13
> Calling cfsetspeed with speed 9600
> cfgetispeed reports speed 13
> 
> On Cygwin, however, the output of the same program is:
> 
> $ ./a
> Calling cfsetspeed with speed B9600
> cfgetispeed reports speed 13
> Calling cfsetspeed with speed 9600
> cfsetspeed: Invalid argument
> 
> If we decide that Cygwin should emulate Linux here, it would be a simple
> matter to copy the glibc code, which checks whether the speed is a numerical
> baud rate and, if so, converts it to a Bnnn constant.

We can do this too.  For historical reasons we should stay careful
taking over other GPLed code into the Cygwin DLL itself, but just
copying the speed_struct struct should be fine.


Corinna

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019