delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/03/11/17:56:42

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
X-Authority-Analysis: v=2.3 cv=OubUNx3t c=1 sm=1 tr=0
a=kiZT5GMN3KAWqtYcXc+/4Q==:117 a=kiZT5GMN3KAWqtYcXc+/4Q==:17
a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=bVP7E8VSAAAA:8
a=0GJe_BP2AAAA:8 a=xNgdfyqHAAAA:8 a=fjDFcf429ns8VtWUCqQA:9 a=QEXdDO2ut3YA:10
a=aVYYs1xEZsgA:10 a=6iwDsAHhQBkA:10 a=Ly10aoh6cllcPZKPqPQE:22
Subject: Re: Setting termios VMIN > 0 and VTIME > 0 on non blocking file
To: cygwin AT cygwin DOT com
References: <9e4c6428-59de-df07-9e33-44ba95d5497f AT gmail DOT com>
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Autocrypt: addr=Brian DOT Inglis AT SystematicSw DOT ab DOT ca; prefer-encrypt=mutual;
keydata=
mQENBFg15Q0BCADc1LTYJN/oVKOJoXpIo+5yy+sBv535qYNRh5CFqp3pPZwIy6oILNKprWph
8J+sXMqYd5H0G1jMDlXendiQbn9SiORuqI7xkV8vzguoFEMhNTxnO1pOQjqRnEnG/W7/5Yy+
DkcCv+Y4O3NX3wol8yP+FaEx4EEEifaO5ZhC1U/ilvHvxE0wjNhRG6AqlvqX6J09bxkJC8Xd
00MZWotDHtiq/wnd8YqyDmf0aJceGxSetHnqn/Cs3WiylEEUy2x/FqKbsBxUJHGQeeRTFAW1
ii08djCemxdE+romE/M9J9CVisSZImbXMSilX6Z2Qtz0lYPkY0EqbiKo8o9zlkIPhaqJABEB
AAG0REJyaWFuIEluZ2xpcyAoU3lzdGVtYXRpYyBTb2Z0d2FyZSkgPEJyaWFuLkluZ2xpc0BT
eXN0ZW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2kFiKK7Q64B
NKl8Y2kRXltaiXfqyvG2U/NiE4GOPA3yZgXs4Mzd1pzV/nkEIzGkneaeE5WGEWj/8dCnn6a3
zIuq0L59QInxKsTdt10OQiUoRKl8Nx0vDCOzMy0wlJc349gJbQBCAZcumtBBBqAzCAmJ3J7T
7ew8hznAEmOwr+LkSOdXFzEjdfTaryhN1AsRLYVUNloEWNA=
Organization: Systematic Software
Message-ID: <5be321d9-10c2-0853-b716-2abd10a4db3a@SystematicSw.ab.ca>
Date: Wed, 11 Mar 2020 15:55:50 -0600
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
Thunderbird/68.5.0
MIME-Version: 1.0
In-Reply-To: <9e4c6428-59de-df07-9e33-44ba95d5497f@gmail.com>
X-CMAE-Envelope: MS4wfBIB8QTO0WjsTahCq+fsbsqacRxWGjDU943Z7cbV4m6B95MFXGGw+67zgr60PwSvjPvP2E6WYsYtL3jsRM7cZYdXGHKErc/1wbWTN/qXDrU/uin+xQTv
rD3Xfh1YSApA2+aBnczui0x6xUAmMQ4hTlIIMOW0Axx0KchRwXK59dzkbXTbWAM/qGEX9h+FJMjpCw==
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW,
SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: Cygwin mailing list <cygwin.cygwin.com>
List-Unsubscribe: <http://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <http://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: <http://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Reply-To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 02BLuNDW006140

On 2020-03-11 14:48, Ã…ke Rehnman via Cygwin wrote:
> opening a file (serial port) with O_NONBLOCK and subsequently setting termios
> VMIN and VTIME > 0 makes read() never ever return any data (returns EAGAIN
> indefinitely).
> Don't ask my why one would want to do something like this but apparently the
> "screen" program think this is a good way of doing things...
> Nevertheless not returning any data ever seems wrong.
> Any insight on how it is supposed to work is welcome.

VMIN > 0 || VTIME > 0 implies blocking; O_NONBLOCK implies SIGIO delivery; see:

	https://www.tldp.org/HOWTO/pdf/Serial-Programming-HOWTO.pdf
	https://www.cmrr.umn.edu/~strupp/serial.html
	https://en.wikibooks.org/wiki/Serial_Programming/termios

also read the man pages carefully and *assume* nothing; functions should work
*exactly* as documented: there be dragons!

You have to set up for, or adapt to, the expected input speed and quantity, the
interrupt response overhead (hardware, OS, and C signal), and what else you want
to be able to do at the same time.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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