From mboxrd@z Thu Jan 1 00:00:00 1970 From: paul.winalski@gmail.com (Paul Winalski) Date: Sun, 25 Feb 2018 11:29:50 -0500 Subject: [TUHS] EOF on pipes? In-Reply-To: <1519519996.29346.for-standards-violators@oclsc.org> References: <1519519996.29346.for-standards-violators@oclsc.org> Message-ID: On 2/24/18, Norman Wilson wrote: > Many years ago (when the dinosaurs were using V6), I had a crazy idea[*] > that a write(fd, 0, NULL) would somehow signal EOF to the reader i.e. a > subsequent read would wait for further data instead of ENOTOBACCO. > > Did any *nix ever implement that? I have no idea how it would be done. > The pipe device driver that I wrote for VMS implemented EOF. Mailboxes (the moral equivalent of pipes in VMS) had a WRITE_EOF I/O command in addition to the usual WRITE. This placed a special record in the mailbox's data stream that caused the driver to return end-of-file when a READ was done instead of simply waiting for further data. My pipe driver had to be fully compatible with mailboxes, so it also had WRITE_EOF. -Paul W.