X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
Subject: Re: Setting termios VMIN > 0 and VTIME > 0 on non blocking file
To: =?UTF-8?Q?=c3=85ke_Rehnman?= <ake.rehnman@gmail.com>, cygwin@cygwin.com
References: <9e4c6428-59de-df07-9e33-44ba95d5497f@gmail.com>
 <5be321d9-10c2-0853-b716-2abd10a4db3a@SystematicSw.ab.ca>
 <5541b350-9992-a0cf-ca77-43a0df83c0a8@gmail.com>
From: Norton Allen <allen@huarp.harvard.edu>
Message-ID: <f9d8744b-9271-9cbe-d79e-6a61b837d94d@huarp.harvard.edu>
Date: Wed, 11 Mar 2020 21:08:03 -0400
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: <5541b350-9992-a0cf-ca77-43a0df83c0a8@gmail.com>
Content-Language: en-US
X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00, GARBLED_BODY,
 RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,
 SPF_PASS autolearn=no 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@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Cygwin mailing list <cygwin.cygwin.com>
List-Unsubscribe: <http://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <http://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <http://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 02C18VeR022807


On 3/11/2020 9:04 PM, Åke Rehnman via Cygwin wrote:
>
> On 2020-03-11 22:55, Brian Inglis wrote:
>> 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!
>>
> According to https://www.cmrr.umn.edu/~strupp/serial.html "*Timeouts 
> are ignored in canonical input mode or when the/NDELAY/option is set 
> on the file via/open/or/fcntl/."*
>
> This leads me to believe the current cygwin implementation is not 
> correct. Changing the VMIN and VTIME should have no effect on the 
> read() behavior if the file was opened with O_NOBLOCK.
> ** 


Correct me if I am wrong, but O_NDELAY is not the same as O_NONBLOCK

--
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

