All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx.manpages@gmail.com>
To: "J.H. vd Water" <henri.van.de.water@xs4all.nl>,
	linux-man <linux-man@vger.kernel.org>
Cc: Ken Brown <kbrown@cornell.edu>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	"Michael T. Kerrisk" <mtk@man7.org>
Subject: Re: Fwd: Simple changes to select(2) and pipe(7) - example program
Date: Wed, 9 Nov 2022 15:02:00 +0100	[thread overview]
Message-ID: <b929dad7-6339-c1f4-52d1-eb1394376f2a@gmail.com> (raw)
In-Reply-To: <9f23de64-4748-5176-1caa-f05b9f4d5f0f@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3118 bytes --]

-------- Forwarded Message --------
Subject: Re: Simple changes to select(2) and pipe(7) -- the message I sent to 
M.K. some time ago.
Date: Tue, 8 Nov 2022 15:58:27 +0100
From: J.H. vd Water <henri.van.de.water@xs4all.nl>
To: Alejandro Colomar <alx.manpages@gmail.com>
CC: mtk.manpages@gmail.com

Alex,

Below the message that I sent to M.K. some time ago; the following subject was used:

"LPI 63.2.3 (when is a file descriptor ready?) /Just a note (for the errata?)"

This message shows 2 things:

  1. it was not me that found the man pages (and LPI) lacking ...
  2. after some effort by me, I decided that Ken's claim was correct and that 
the man
     pages ( select(2) and pipe(7) ) needed to be improved ...

Regards,
Henri

-------- Forwarded Message --------
Subject: LPI 63.2.3 (when is a file descriptor ready?) /Just a note (for the 
errata?)
Date: Thu, 29 Sep 2022 14:31:45 +0200
From: J.H. vd Water <henri.van.de.water@xs4all.nl>
To: mtk@man7.org

Dear Mr. Kerrisk, Michael

I decide to drop you a note about LPI/ select() ...

  - https://cygwin.com/pipermail/cygwin/2022-September/252246.html

    (Re: FIFO issues - response by Ken Brown in which he announces
     the correction of his implementation of select() - in Cygwin)

Recently I have been reading (and rereading)

  - LPI ch44 (Pipes and FIFOs)
    especially ch44.7 (FIFOs), ch44.9 (Non blocking I/O) and
    ch44.9 (Semantics of read() and write() on pipes and FIFOs)

  - LPI ch63 (alternative I/O methods)
    especially ch63.2 (I/O Multiplexing), ch63.2.1 (The select()
    system call and ch63.2.3 (When is a file descriptor ready?)

and the associated manual pages ...

(and wrote code that confirms that a note should be included with
  the "official documentation")

Why? Because of the problem that was reported against Ken Brown's
implementation of select() (Cygwin).

---
 From LPI ch63.2.3 (When is a file descriptor ready?) and from the
manual pages, I got the "impression" (and so did Ken Brown), that

     the read end of a FIFO is "read ready" when the write end of
     the FIFO is (still) closed.

However that turned to be true ONLY AFTER the FIFO has been opened
and closed once ...

True where? It turned to be true for Linux and the "other Unixes".

Any proof you may ask?

Ken Brown implemented select() (Cygwin) according to the "official
documentation".

The thread (see the above URL) makes it clear, that Linux and the
"other Unixes" behave different (how? see above) from Ken Brown's
implementation of select().

Ken B. modified his implementation of select() (see URL). The URL
includes the test program he used to verify his modification.

Bottom-line: the official documentation (LPI, manual pages) should
include a note:

     the read end of a FIFO is NOT "read ready" when the write end
     of the FIFO has never been opened (still closed)
     (when the write end has been opened and closed once, then the
      read end will be "read ready" from then on)

With kind regards,

Henri (J.H. vd Water)

-----

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-11-09 14:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <30847211-efc7-12be-6ce9-c5c4ada16805@xs4all.nl>
2022-11-09 13:57 ` Fwd: Simple changes to select(2) and pipe(7) - example program Alejandro Colomar
2022-11-09 14:02   ` Alejandro Colomar [this message]
2022-11-09 14:04     ` Alejandro Colomar
2022-11-09 14:04       ` Alejandro Colomar
2022-11-09 14:15   ` Alejandro Colomar
2022-11-09 15:06     ` J.H. vd Water
2022-11-09 15:32       ` J.H. vd Water
2022-11-22 12:22       ` Simple changes to select(2) and pipe(7) J.H. vd Water
2022-11-22 12:25         ` J.H. vd Water
2022-12-01 14:39           ` J.H. vd Water

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=b929dad7-6339-c1f4-52d1-eb1394376f2a@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=henri.van.de.water@xs4all.nl \
    --cc=kbrown@cornell.edu \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=mtk@man7.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.