From: Enrico Forestieri <forenr@lyx.org>
To: cygwin@cygwin.com
Subject: Re: FIFO issues
Date: Tue, 20 Sep 2022 00:05:57 +0200 [thread overview]
Message-ID: <1b28b650-b588-e34f-919e-e75f5a01196f@lyx.org> (raw)
In-Reply-To: <a3084ca6-ea7b-535c-c0fb-2c29e20b7ddb@cornell.edu>
[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]
Ken Brown wrote:
> I did an internet search on this issue and found the following, which
describes the
> situation we're discussing:
> https://stackoverflow.com/questions/14594508/fifo-pipe-is-always-readable-in-select
> According to that post, select on Linux will wait for a writer the
first time it's
> called to check read readiness for a FIFO opened for reading with
O_NONBLOCK set.
> But if the writer then closes the FIFO, subsequent calls to select
will always find
> the FIFO read ready (and read will return 0). This behavior is not
documented, as far as
> I can tell, and in fact it contradicts the existing documentation
(both POSIX and Linux).
> So I don't think someone trying to write a portable program should
rely on it.
Please, note that this code was working on cygwin the way it works on
linux until some
time ago, maybe last year, I am not sure. I also found this
stackoverflow discussion:
https://stackoverflow.com/questions/28851639/select-with-non-blocking-reads
I tried the code also on Solaris and NetBSD and it works exactly as on
linux, so I think
it is portable.
--
Enrico
next prev parent reply other threads:[~2022-09-19 22:06 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 [this message]
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
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=1b28b650-b588-e34f-919e-e75f5a01196f@lyx.org \
--to=forenr@lyx.org \
--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).