public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin@cygwin.com
Subject: Re: FIFO issues
Date: Tue, 20 Sep 2022 09:18:01 -0400	[thread overview]
Message-ID: <58359837-fd07-50a0-d5f8-b07bf425b7df@cornell.edu> (raw)
In-Reply-To: <YyljrduQ+ljG6OOa@GIOVE>

On 9/20/2022 2:54 AM, Enrico Forestieri wrote:
> On Mon, Sep 19, 2022 at 07:54:11PM -0400, Ken Brown wrote:
>> Then I guess I'm wrong.  I'm really puzzled, because it seems that none of these
>> platforms agree with POSIX, which says the following in its 'read' documentation:
>>
>>       When attempting to read from an empty pipe or FIFO:
>>
>>           If no process has the pipe open for writing, read() shall return 0 to
>>           indicate end-of-file.
>>
>> It seems that there's an exception: If no process has ever had the FIFO open for
>> writing since it was opened for reading, then the FIFO is not considered to be
>> at end-of-file.
>>
>> I'll look into fixing this.  But I'd be more confident about it if I could find
>> some documentation of the existing behavior.
> 
> I compared the behavior of read() and select() on 3 different platforms.
> My conclusion is that, actually, read() behaves the same on all of them,
> whereas cygwin differs in the way select() works.

Then I'm even more confused than I was before.  Are you saying that there are 
situations in which read() reports EOF but select() does not report read ready? 
Could you post the code you used for testing?

Thanks.

Ken

  reply	other threads:[~2022-09-20 13:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-18 21:45 Enrico Forestieri
2022-09-19 19:15 ` Ken Brown
2022-09-19 19:50   ` Norton Allen
2022-09-19 19:53     ` Norton Allen
2022-09-19 21:25       ` Ken Brown
2022-09-19 21:28         ` Norton Allen
2022-09-19 22:05         ` Enrico Forestieri
2022-09-19 23:54           ` Ken Brown
2022-09-20  3:51             ` [EXTERNAL] " Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2022-09-20  6:54             ` Enrico Forestieri
2022-09-20 13:18               ` Ken Brown [this message]
2022-09-20 17:20                 ` Enrico Forestieri
2022-09-23 15:36                   ` Ken Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58359837-fd07-50a0-d5f8-b07bf425b7df@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).