delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/08/19/04:36:18

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=q9q2/EpeGL6Jcp4JergixIB/pdbo2PrIYAwi7o4S0qHd016jMSFRQ
RUpeTIg/pPLU5pGWWYn628rUuMbPT2LBoSpROmKjFJycHKxQ+Qd9hV4XJSXGJ0/H
PdOmOS6F0fGWnaOFKtT+Dgsh/sSaDrzcm5f9Sj16dCZe4nmzFVghGU=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=GOW7Ew5MJjcAKNtPNlVpIW1Fw9Q=; b=D4exeNwPSGGieMmJ/m9Hy33sC1c/
Der7nDjDdKIJ4sR6yJ3bInNzEnRUkDj/YhAVsdh4PQoaLbykIxgQ5PwIdJPwd47s
In9z0hYST2CCqdF4aKOndTM/S2D/ZtrBf951GmKZjIVcmOD7NzuSWEBa/sX1CAgf
EVl70EgfsJ1PEWw=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2
X-HELO: calimero.vinschen.de
Date: Tue, 19 Aug 2014 10:35:29 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Bash uses lseek while reading from serial device
Message-ID: <20140819083529.GL2280@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20140819023953 DOT 61416351B0 AT mail DOT csclub DOT uwaterloo DOT ca>
MIME-Version: 1.0
In-Reply-To: <20140819023953.61416351B0@mail.csclub.uwaterloo.ca>
User-Agent: Mutt/1.5.23 (2014-03-12)

--Qo8f1a4rgWw9S/zY
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Aug 18 22:39, Ross Ridge wrote:
> Corinna Vinschen writes:
> > On Linux isatty on a descriptor connected to serial line returns 0,
> > on Cygwin it returned 1 so far.  I fixed both problems here, isatty
> > on a serial line returns 0 now, and lseek on serial (and, FWIW,
> > sockets) don't simply return 0 anymore, but rather -1 with errno set
> > to ESPIPE, as on Linux.
>=20
> I'm not sure if Chet Ramey's suggestion that if isatty() returns 1
> then bash is allowed to assume reads are newline-delimited is correct.
> On Unix this would only be true if cannonical mode input processing was
> enabled (icanon), and Cygwin stty reports that this mode is disabled
> (-icanon) on serial devices.  Or at least it used to, with the snapshot
> DLL it now complains "/dev/ttyS0: Inappropriate ioctl for device".
>=20
> For what its worth my tests on Linux shows that isatty() returns 1 on
> a serial device, namely /dev/ttyS0.  Which is what I would expect given
> that serial devices have traditionally been synonymous with ttys on Unix.

I reverted this part of the patch.  My test was flawed.  The problem is
that on Linux, /dev/ttyS[0-3] exists even if they are not backed by
hardware.  In this case, as is on my local machine, isatty returns 0.
However, if there's a device connected to /dev/ttySx, isatty returns 1.

So I just applied a patch which reverts the isatty status to /dev/ttySx
and thus, stty works as before.

> > Ross, please give it a try.
>=20
> The snapshot DLL solves the bug and the script runs without any data
> being lost.  Thanks for looking into this.

Thanks for testing and discussing this problem.


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--Qo8f1a4rgWw9S/zY
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJT8wxRAAoJEPU2Bp2uRE+gcUIP/2ZxAwW8jP/R9ppAmjYXJdef
qX87hd5zGvUE8dKGPE66jRHjw4T8dkpu4Li/nX2q5EiSt8I3JoknOVhftqjJkjEG
HD9a47H6pCV0SM2QPt9FceeiyAHzVbyHH39xM9cgVQ/8LEvIoSl1TIJLjSHMAXN3
Nolo6tF+hJJ4Zhx/54kCbfXiU7oH4flyQTr2Uvdk36YdzXNdvxQq4AqS3hu6dovv
Xe8ivOVYP0Z8rauTa8Gqsqoz6Hp2sXDuzJloX1IjRVSxXlL6Lu44rfk6dj/gUcno
BrsjfO/tDkXc7ZJGreoAIUauPW8JDMWKETnFTmpur7zPHhKTaLyFeLIhYuQV2taG
0LY4r4N6zhsUGL9H737jWVJS3P89W55VKZFh7x/L6/puAghB4Y6+637YeFlaX8oL
S8QGJ8KWzokqCNMBJFb4rN8r/814CV7CJXsuv6JDHWhqB5I7vtE7zczbXaGMA/H2
GfOlUfx0UJ7anZXZE0wYZeCcF0tIjjUajUaX0BJW19RZNQiZqNj61ZRnh0CxiWe3
B4owaXcYNCBXbMZT8ku6J/3qvoxUkDlj7zm7Br7Xa+msRTJthKN+xCdfX81zI8SI
H7dr3zAc7U3METThJlnb3eRWZQs9AMmCmQryPraLm7Rruu2BZ/NqffvvkH6geoQX
sHPAAsrRYgXQCfnAPuO2
=ewW7
-----END PGP SIGNATURE-----

--Qo8f1a4rgWw9S/zY--

- Raw text -


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